5

What's the best module for a session timeout?

I simply want users to be automatically timed out after a period of inactivity.

The Automated Logout module looked like it could to the trick, but it seems like it does a lot more too. Also, I am using Drupal 7 and it's still in dev.

closed as off-topic by Clive Oct 10 '17 at 12:36

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions asking to recommend or find a book, tool, module, theme, distribution, tutorial, or other off-site resource are off-topic for Drupal Answers as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it." – Clive
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    Autologout now has a proper drupal 7 release and works as advertise. – rooby Aug 8 '13 at 11:02
6

You have two options in the settings file that should allow you to configure the session timeout however you wish, session.gc_maxlifetime & session.cookie_lifetime.

/**
 * Set session lifetime (in seconds), i.e. the time from the user's last visit
 * to the active session may be deleted by the session garbage collector. When
 * a session is deleted, authenticated users are logged out, and the contents
 * of the user's $_SESSION variable is discarded.
 */
ini_set('session.gc_maxlifetime', 200000);



 /**
  * Set session cookie lifetime (in seconds), i.e. the time from the session is
  * created to the cookie expires, i.e. when the browser is expected to discard
  * the cookie. The value 0 means "until the browser is closed".
  */
ini_set('session.cookie_lifetime', 2000000);

Not the answer you're looking for? Browse other questions tagged or ask your own question.