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
Share on other sites

Well anything you store in cookies are unsecure, anyone can copy the cookie and use it on their computer. But the hard time is someone actually getting ahold of those cookies. I would store the md5 with a salt and a username.

Link to comment
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.