Current location: Hot Scripts Forums » Programming Languages » PHP » secure login without sessions or cookies


secure login without sessions or cookies

Reply
  #1 (permalink)  
Old 05-21-10, 05:26 AM
vinpkl vinpkl is offline
Newbie Coder
 
Join Date: Oct 2008
Posts: 63
Thanks: 3
Thanked 0 Times in 0 Posts
secure login without sessions or cookies

hi all

i have created a new module for my site that has login area but its sessions are conflicting with another login area i think. so dont know what code to post.

so is it possible to create login authentication without sessions and cookies.

at present what i am thinking is setting the field "authorization" to "True" in my database when the user enters correct username and password and setting it ''false" if user logs out.

but in this way anyone can access the admin area till the user clicks logout buton because in this way "authorization" is set to "true" for every user till logged in user clicks logout button. anyone who knows the admin pages url can type the url in address bar and see the data in pages till the loggedin user logsout.

so what else can i do without sessions and cookies.


vineet
Reply With Quote
  #2 (permalink)  
Old 05-21-10, 08:10 AM
job0107's Avatar
job0107 job0107 is offline
Community Liaison
 
Join Date: Dec 2006
Location: Tacoma, Washington USA
Posts: 3,454
Thanks: 0
Thanked 140 Times in 137 Posts
If you use an authorization field in the database to keep track of who's logged in and logged out,
you are going to end up with a lot of queries to the database.
Proper security requires you to check their logged in status every time the user goes to a new page.
That's the purpose of using a cookie or a session variable.
Cookies can time out, and that can be very useful if there is no activity for a while.
And session variables are stored in memory, that can make traversing your website a lot faster.

Sense you created the module, you should be able to come up with a unique key for the session variable or cookie in question.

I have seen many sites where you have to login several times depending on what area of the site you are accessing.
And it's possible to have unique usernames and passwords for each area.
Some areas of the site log you out when you leave the area.
While the main part of the site keeps you logged in.
There are several ways to go about this.
But using the database to keep track of your login status, will create a lot of extra activity on the server and may use up your bandwidth in a very short time.
__________________
Jerry Broughton
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How important are folder user/security permissions for php login & sessions? jdlev PHP 2 12-02-08 11:42 PM
Login script - Secure? Deansatch PHP 5 06-05-08 12:16 PM
Working with sessions in login form zoliky PHP 6 07-17-06 03:08 AM
Login page with cookies zoliky PHP 6 07-07-06 08:50 AM
how to get my sessions script work with cookies JM007 PHP 1 06-24-03 08:06 AM


All times are GMT -5. The time now is 08:15 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.