Logout after X minutes of inactivity?

Events happening in the community are now at Drupal community events on www.drupal.org.
bob_irving's picture

I'm using Drupal 5.7 for my classes. Since much of the use occurs in a shared computer lab, is there any way in the settings to terminate a user's login after a while? I've done some searching and can't find any easy fix.

The problem is that a user logging on from a computer will be logged in automatically as the user who sat at that computer previously, unless they logged out. I realize that it's good practice to log out, but we're talking about middle schoolers here.

Thanks in advance,
Bob

Comments

javascript?

btopro's picture

I'm not sure about server side solution that's already been created but in javascript it would be pretty easy to say if there's been no activity for.....x number of minutes to redirect the current site to the logout page. Just add in some mousemove or mouseclick qualifiers or something to reset the count down till logout.

I also don't know of anything that currently exists to do this but it would be a pretty small patch/module from the js end.


"Moodle? What's moodle?"

http://elearning.psu.edu/
http://elearning.psu.edu/projects
http://drupal.org/project/outline_designer
http://drupal.org/project/html_export

Auto Logout

bgregoire's picture

I used this module before for auto logout after a certain period of inactivity before, perhaps that will work for you.

http://drupal.org/project/autologout

This module looks

bradweikel's picture

This module looks promising... http://drupal.org/project/autologout (Doh! someone beat me to it)

Haven't tried it, though.

You can also force logout when the browser closes, which is what I use on most sites
http://drupal.org/node/16217#comment-112793

I installed the autologout

bob_irving's picture

I installed the autologout module and will have it beta tested later this week. Thanks for the suggestions!

You can also limit the

bonobo's picture

You can also limit the length of sessions in settings.php


FunnyMonkey
Tools for Teachers

If I limit the length of

n00bie's picture

If I limit the length of sessions in settings.php, say to

ini_set('session.cookie_lifetime',  300);

then will the user be logged out after 5 minutes or after 5 minutes of inactivity?

5 minutes

dwees's picture

Just 5 minutes, the session is created when the user logs in, and after 5 minutes they would have to re-login.

The only difficult pages for this type of module to handle are the node/add pages. Everything else should be fine. Maybe the auto log-off script would have to check for keyUp and every time it happens, reset the timer?

Dave