How can I logout users after a certain period of inactivity (say 20 minutes)?


You are looking for Automated Logout module.

This module provides a site administrator the ability to log users out after a specified time of inactivity. It is highly customizable and includes "site policies" by role to enforce logout.


  • Different timeouts based on role
  • Disabling of timeouts based on role
  • Permission for users to set their own timeout
  • Includes some JS mechanisms to keep uses logged in even if multiple tabs are open or if the user is working on a form for a long period of time.
  • Includes developer hooks to allow users to remain logged in depending on your own project specific requirements
  • Optional integration with Javascript Timer

(or) take a look at Session Limit


Ejector Seat

A Drupal module to immediately log out (eject) a user whose session has ended

  • Thanks for your quick response, i specified timeout value in seconds as 2 min (120seconds). The session is not getting expired after the specified time.how do i proceed
    – user24393
    Dec 12 '13 at 10:19
  • Which module your talking about among the 3 I specified, If it not working then it is probably a bug, better you submit to the module issue queue.
    – Bala
    Dec 12 '13 at 10:21
  • i have used Automated Logout module. but it the session not getting expired after the specified time.
    – user24393
    Dec 12 '13 at 11:17
  • can't we use any custom code to do the session logout after some period of inactivity?
    – user24393
    Dec 12 '13 at 11:18
  • @user24393 check this stackoverflow.com/questions/2186115/…
    – Bala
    Dec 12 '13 at 11:23

You can change the session.cookie_lifetime time (in seconds) from the session is created to the cookie expires (when the browser is expected to discard the cookie).

There is a module Session expire which enhances that functionality.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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