By systechguy on
I just installed Drupal 6.8 and noticed that after I logged into my drupal instance with my admin login account and didn't log out but just closed my browser, the next day when I opened my browser again and went to the drupal site, the admin account was still logged in.
How can I have drupal perform an automatic logout when a browser window closes, or after a certain time of inactivity?
Comments
You'll need to change the
You'll need to change the timeout of the session cookie. Look for the session.cookie_lifetime setting in your sites/default/settings.php file.
Automatic logout time Starts from beginig if page is refreshed!.
When I refresh the page, the log out time starts counting from beginning. Please give me a solution to continue the log out countdown time even though page is refreshed.
Have you tried the Automated
Have you tried the Automated Logout module discussed further down the thread?
More than one way
Your login actually does time out. It's just longer than you realize. Drupal uses a cookie to maintain the session. The default setting for session.cookie_lifetime (if I remember right) in your settings.php file is "200000" seconds which is 2.3 days. You can change this to whatever you like. If you make it "0" then your session will expire as soon as you close your browser.
Another way is to use a module like Automated Logout found here --> http://drupal.org/project/autologout
Cookie Lifetime
In my settings.php file the default session.cookie_lifetime', was set to 2000000 which would give it a 23 day life time.
Just for the newcomers like me having trouble to change / amend the settings.php file - remember you need to change the attribute to write (777) before you can change the file. This is not always easy and you may have to work out how to do it depending on whether you are using a localhost setup or a remote server.
I find it easiest to use Cpanel on my remote server, rather than my FTP client (FilleZilla / FTP commander / PSPad's FTP client, etc.). On my localhost setup I use Explorer mostly or something like Free Commander to change the attributes.
Remember Drupal will re-protect the settings.php file as soon as you access the website and get it to work through its paces (cron job, calling module node, etc.). So, experimenting with changes to the settings.php file can be a bit tiresome as you always have to watch whether your changes have actually been safed.
(Drupal 6.8. - settings.php - Line 142-143)
ini_set('session.cookie_lifetime', 2000000);note: 2000000/60sec/60min =~ 555.555 hours/24 hours =~ 23.15 days
I also added the second line to highlight/refer to the discussion under - http://drupal.org/node/35891 - Removing old sessions .
Thank You to everyone for
Thank You to everyone for the info!
Automatic logout time Starts from beginig if page is refreshed!.
When I refresh the page, the log out time starts counting from beginning. Please give me a solution to continue the log out countdown time even though page is refreshed.