Frank Vèssia Posted October 22, 2012 Share Posted October 22, 2012 Hello, what is the best way to implement e remember me function for a custom users login ? Link to comment Share on other sites More sharing options...
WillyC Posted October 23, 2012 Share Posted October 23, 2012 cookies.is great way, no? Link to comment Share on other sites More sharing options...
ryan Posted October 24, 2012 Share Posted October 24, 2012 I agree, cookies would be the way to set this up. You'd just set a cookie with the user's name and pre-populate the field with the name from the cookie (after sanitizing it with $sanitizer->pageName). You could do this with PHP or Javascript. But I'd probably use PHP just because the logic of figuring out when to store the value (after login) would be simpler from the PHP side. Link to comment Share on other sites More sharing options...
Frank Vèssia Posted October 24, 2012 Author Share Posted October 24, 2012 OK, thanks Link to comment Share on other sites More sharing options...
Jonathan Lahijani Posted July 2, 2013 Share Posted July 2, 2013 I agree, cookies would be the way to set this up. You'd just set a cookie with the user's name and pre-populate the field with the name from the cookie (after sanitizing it with $sanitizer->pageName). You could do this with PHP or Javascript. But I'd probably use PHP just because the logic of figuring out when to store the value (after login) would be simpler from the PHP side. Isn't the idea you described just to remember a user's username in a cookie, even after they've logged out, so that it'd prepopulate a login form with their name? What would be the best approach for truly keeping them signed in (unless they specifically log out), even after they've closed their browser? Basically a "Remember Me" feature much like WordPress or other web apps (Google, etc.) where it expires after a couple weeks. I'm having difficulty with this. Link to comment Share on other sites More sharing options...
fmgujju Posted July 2, 2013 Share Posted July 2, 2013 Adding a remember me feature to your php login script tutorial: http://www.downwithdesign.com/web-development-tutorials/adding-remember-feature-php-login-script/ Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now