Jump to content

Which sessions to use when determining if a user is logged in or not


sorenchr

Recommended Posts

Hi there, quick question:

 

For determining if a user is logged in or not, when he/she is surfing on your site, what would be the best way to check this?

 

Currently i have two sessions which i check, 'username' and 'loggedin', 'username' is of course the username, and 'loggedin' can have a value of either 1 or 0. Is this fine enough for security? Or is this an open invitation to session highjacking?

 

The users passwords are sha1 encrypted before they are stored in the db. I'm thinking of using a 'password' session (instead of 'loggedin'), and then match up 'username' and 'password' with the db instead of just checking if 'loggedin' is 0 or 1. Would this be a more secure solution?

 

Thanks for your time.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.