Currently this module does not logout the user if they reopen their browser, even a day later.

Maybe we could implement a kill command on browser exit, here's an example
http://eureka.ykyuen.info/2011/02/22/jquery-javascript-capture-the-brows...

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

alabandit’s picture

Issue summary: View changes
johnennew’s picture

Status: Active » Postponed (maintainer needs more info)

Sorry for the delayed response.

The code in the modules hook_init implementation will log the user out if they revisit a page outside the timeout so there should be no need to capture a browser close event.

I set the timeout for a user to 60 seconds, logged in as them, closed the browser window, waited for 2 minutes, reopened the browser window and saw a message about being logged out because of inactivity.

I cannot replicate the issue described here so setting to needs more info. Anyone able to provide reliable steps to reproduce please do reopen the issue.

lisotton’s picture

Status: Postponed (maintainer needs more info) » Active

It's happening when you use some module that cache the whole page for logged users, Authcache, for instance.

When you use Authcache, the request don't go trough the hook_init because it intercepts the request and deliver the request to the logged user.

One solution in this case could be to call the Ajax as soon as the page is loaded, not only after 60 seconds.

ljcarnieri’s picture

We created one patch that execute the method init in javascript immediately if authcache is enabled and if is valid add too authcache-debug url in hook_autologout_prevent to prevent that authcache debug set $_SESSION['autologout_last'] if enabled.

ljcarnieri’s picture

Status: Active » Needs review
Alan D.’s picture

Why not a simple cron task to delete from the session table?

imclean’s picture

Version: 7.x-4.3 » 7.x-5.x-dev
Related issues: +#2846299: Delete user session for users who closed the site
imclean’s picture