473,387 Members | 1,578 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

What do you use instead of sessions for password protected

pages?

For low traffic sites I just use sessions and redirect if not logged in

<%
if NOT session("loggedIn") = "true" then
response.redirect("index.asp")
end if
%>
Is this a really that bad of an idea? It's just four little characters.

Jul 19 '05 #1
3 1698
No, I think that's the best thing to do. Other options:

Use NT authentication for your site.
- I prefer to keep this for intranets or for sites that will just have a
handful of logins and not an open registration system.
Use cookies.
- Relies on clients' acceptance of cookies.

Ray at home

"Yarn" <no**@noaddress.com> wrote in message
news:#2**************@TK2MSFTNGP09.phx.gbl...
pages?

For low traffic sites I just use sessions and redirect if not logged in

<%
if NOT session("loggedIn") = "true" then
response.redirect("index.asp")
end if
%>
Is this a really that bad of an idea? It's just four little characters.

Jul 19 '05 #2
On Wed, 17 Sep 2003 19:32:22 -0700, "Yarn" <no**@noaddress.com> wrote:
pages?

For low traffic sites I just use sessions and redirect if not logged in

<%
if NOT session("loggedIn") = "true" then
response.redirect("index.asp")
end if
%>


Thats a very common method. I would add one item though. With this
scheme, you know that someone logged in, but you dont know WHO logged
in. Save the user's ID in the session variable, or save the session ID
in your database so you can look up who logged in. This takes even
less space and gives you more information :)

Jul 19 '05 #3
I would change it to :
If Session("LoggedIn") = "" Then
Response.Redirect "index.asp"
End if

If the user is NOT logged in than the session variable would be empty and
not "false"

Now you have 2 boolean expressions
Session("LoggedIn") = "True" is boolean expr #1
If you use the NOT, you use boolean #2 on boolean #1

Meindert, MCP

For low traffic sites I just use sessions and redirect if not logged in

<%
if NOT session("loggedIn") = "true" then
response.redirect("index.asp")
end if
%>
Is this a really that bad of an idea? It's just four little characters.

Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Steve Fitzgerald | last post by:
The below login script does work. The form does not seem to be submitting. I keep getting the username and password fields. The only errors I get are notices that email and password and undefined...
6
by: Chewy509 | last post by:
Hi Everyone, I'll just start, and say I am not a PHP developer (I'm a sysadmin, who has gotten lumped with a non-working website). But since I like to do this type of stuff, I though I might...
9
by: chris | last post by:
im just starting to learn how sessions work and how to use them my question is if im geting a username and password from a visitor is it secure to store that information in a session variable or...
1
by: danarz | last post by:
I am not what I am doing wrong. When I enter the log-in info and press submit, I keep getting the login section repeatedly (I never get loged-in). It works fine if I delete the php session lines....
5
by: bryan | last post by:
Hi folks, I've got a question about sessions in PHP. I'm a *gulp* ASP coder, so please bear with me. I developed a PHP site a few months back that has a password protected entry into a...
2
by: dmcconkey | last post by:
Hi folks, I have two PHP questions concerning objects stored in sessions. I'm developing an intranet for a client to be run in a Redhat 8/Apapche 2/PHP 4/MySQL environment. All pages are...
5
by: frankarturi | last post by:
I have a members area full of video clips. Clips are inside /hide/videoclips/ and /hide is apache protected directory by .htaccess Users can enter by a login.php (entering user and password)...
1
by: Chris | last post by:
I have a frontend that has some tables which are linked to a backend. Now I want to make the backend password protected and when I try to run it password protected I can't open it. In the first...
4
by: connoisseur.infotech | last post by:
hello we are developing one tool where we need to open and make password protected zip files. we found some solutions but they don't support password protected things. does any one knows about...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.