I'm sure that this question/issue has been resolved some way because I've seen it working on sites like devot-ee, but how can I get the 'Remember Me' functionality working for when user login to the front-end of a site?
Thanks in advance.
If you already have the auto_login field in your login form and it's just not working, you are probably running into a long standing bug where Remember Me just doesn't work consistently or correctly. Here are two possibly related bug reports:
Add a checkbox with the name auto_login to your login form
So this may or may not solve your issue but we were having problems getting this to work for quite awhile and I decided to make my own patch to the EE core files. It only works for my instance but if you can get the general idea if should help you.
The remember me functionality is broken for multi site logins (so this patch will only work for that).
There are two parts that are important for the remember_me to work.
The issue with multi site login is that it gives the cookie in the first login and fills the members table with the hash value. It then redirects to do the second (or more) site logins but without the remember_me input being checked in the form (that is the bug) which causes the remember_me field in the members table to be wiped out.
Though I believe there is a more elegant solution involving passing the hashkey generated o the first login along with the checked remember me input through to the next logins, I haven't gone that far yet. My solution will solve remember_me issues for the first site (which is all we really required).
WARNING: It involves modifying core files which I have a lot of experience with. This is sort of an advanced user patch.
Add a field to the members table, remember_me_timestamp INT(10).
Modify the function start_session in the core Auth.php file to do a timecheck on when the remember me was filled:
That was the code I added to the start_session function. Replacing:
The idea is that when it does the first login, it has the remember me post data filled so it inserts the key, sets the cookie and also inserts the timestamp. On subsequent site logins (which happen consecutively in a small span of time) if the remember me post data is empty (which it will be because of the bug) then it checks the timestamp to see if an hour has past since the last remember me (really it could be like 10 seconds). If the time limit hasn't been passed then it won't blank out the remember_me field in the members table.
Hopefully this helps some people but considering the skill level usually required to edit core files, I would prefer to see ellislabs make an actual patch (they could have by now I suppose, I just don't updated because of all my custom edits).