Jump to content

Staying Logged in


Demonic

Recommended Posts

Okay, I'm using sessions for user system right, and so far I know you need cookies to stay logged in.  I'm worried about security.

 

Is storing the md5 hash and user id in a cookie secure?  Was thinking about what if someone tries throwing that hash into a rainbow table, getting the password.

 

So I was thinking possibly setting a cookie for a week, but make them reenter their password again after 24 hours and store the last time user tried logging in, into the database.

 

Would this be pretty secure?

Link to comment
https://forums.phpfreaks.com/topic/101476-staying-logged-in/
Share on other sites

Is storing the md5 hash and user id in a cookie secure?

 

The hash of what?

 

if your using a sess_id then also keep track of last sess_id so when return check against last and update cookie to new... then it's reset on every new browser session, you could do a length of time thing as well just for good measure?

Link to comment
https://forums.phpfreaks.com/topic/101476-staying-logged-in/#findComment-519101
Share on other sites

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.