Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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...
Comments
Comment #1
alabandit CreditAttribution: alabandit commentedComment #2
johnennew CreditAttribution: johnennew at Deeson commentedSorry 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.
Comment #3
lisotton CreditAttribution: lisotton at CI&T commentedIt'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.
Comment #4
ljcarnieri CreditAttribution: ljcarnieri at CI&T for CI&T commentedWe 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.
Comment #5
ljcarnieri CreditAttribution: ljcarnieri at CI&T for CI&T commentedComment #6
Alan D. CreditAttribution: Alan D. commentedWhy not a simple cron task to delete from the session table?
Comment #7
imclean CreditAttribution: imclean commentedComment #8
imclean CreditAttribution: imclean commented