Jump to content

remember me for login


Frank Vèssia
 Share

Recommended Posts

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

  • 8 months later...

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...