php_guy Posted December 11, 2007 Share Posted December 11, 2007 Hello guys, I thought I would post another topic since it's really a separate issue. How can I create a "Keep me logged in" feature where if users select this checkbox prior to typing their username/password, then the system will remember that user and they will not have to re-type their credentials everytime. I know this can be done, but I'm not sure how! Maybe cookies? I'm not sure?? (Also, if possible, I want to avoid having to store the user's password in plain text on their system...can this be done?) Quote Link to comment Share on other sites More sharing options...
lemmin Posted December 11, 2007 Share Posted December 11, 2007 Cookies should work fine. I would suggest keeping all "Keep me logged in" users in a table for their session to avoid any security issues with cookies. So, when a user logs in with the box checked to stay logged in, put their account number in a "logged in" table. Then, When you check if someone is checked in, either check for both the cookie and the entry in your db. If it's all there, then they have logged in before and aren't just manipulating cookies. Here is the cookie page: http://www.php.net/manual/en/features.cookies.php Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.