Some Users are complaining that they close their browser after accessing my site and then go back to the site the next day and they are already logged in. I looked into this and it appears what is really happening is that Drupal is setting a cookie and when the user returns, the site uses the cookie to automatically log the User into the site.
For me I like this feature but some of my site users are really ticked off about this. (go figure) They feel much more comfortable logging in each time they go to the site. I've tried explaining to them what is going on and all they have to do is click the logout link before closing the browser but to no success.
My question is, how do I prevent this behavior? What I would like to do is create a checkbox in the User Account that would tell Drupal not to automatically log the user in but to require the user to log in each time that initially go to the site.
I am using D7 (latest released)
If anyone has any suggestions on how to do this or an alternative idea I would appreciate the help.
Thank you in advance.
David
Comments
Try changing the lifetime to
Try changing the lifetime to 0 in your settings.php
Changeini_set('session.cookie_lifetime', 2000000);
to
ini_set('session.cookie_lifetime', 0);
Remember to clear your browser before you test to see if it's working
Dear tommyent,I tried your
Dear tommyent,
I tried your suggestion and it seems to be working. I had to run the test over night (which is what my users are complaining abut) and it looks like it worked.
Got to do more testing to make sure and with other users.
Thank you.
David
There are also modules that
There are also modules that fix this, but I can't find one that has a stable release for D7:
http://drupal.org/project/persistent_login
http://drupal.org/project/remember_me
Anyone else?
Learn more at iRolo.net.
No
Remember Me was the one I thought of but it seems as if it was abandoned.
Perhaps http://drupal.org/project/session_expire
Dear RoloDMonkey and
Dear RoloDMonkey and tommyent,
I did look for a module and noticed that there was nothing for D7 (bummer). which is why I asked here and I think that tommyent's suggestion is going to work.
But thank you both for your replies
David
No problem. Session expire I
No problem.
Session expire I think (didn't install or browse the code) will let you change the lifetime and is in active development for 7 so if things fail for whatever reason it's worth taking a look.