I'm not sure if this is a bug or a limitation, but it's potentially confusing.

When you request a page (page #1) the block correctly starts counting down (I'm using JStimer with Auto Logout). If you go to another page (page #2), it'll restart; again, that's fine. But if you then use the "back" button to return to page #1, it'll restart again.

This isn't correct, is it? I'm guessing that the page is reloaded from the browser cache rather than from the Drupal server, so the system will still be counting as of page #2.

Feel free to tell me if I'm completely wrong here...

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

johnennew’s picture

Version: 6.x-2.x-dev » 7.x-4.x-dev
Assigned: Unassigned » johnennew

You're not wrong (even after 3 years)!

I have confirmed the behaviour in head. It affects all the JS timers including the one that challenges you to remain logged in on the 4.x branches. So, pressing back you get logged out before the timer and popups tell you you are logged out.

Fix here looks like:
http://stackoverflow.com/questions/829046/how-do-i-detect-if-a-user-has-...

Moving to head, note this won't be back ported to 2.x - only 4.x is supported.

johnennew’s picture

Title: Counter restarts after using "back" button - problem? » Counter restarts after using "back" button problem
Component: Miscellaneous » Code
Category: support » bug
Status: Active » Needs review
FileSize
1.84 KB

Patch for the 7.x-4.x branch attached.

Status: Needs review » Needs work

The last submitted patch, autologout-back_button_support-809928.patch, failed testing.

johnennew’s picture

Status: Needs work » Needs review
johnennew’s picture

Version: 7.x-4.x-dev » 6.x-4.x-dev
Status: Needs review » Active

Committed to 7.x-4.x branch, setting 6.x-4.x for backport.

johnennew’s picture

Status: Active » Needs review
FileSize
3.95 KB

Patch for 6.x-4.x branch

johnennew’s picture

Status: Needs review » Fixed

Tests pass - committing to 6.x-4.x

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

  • Commit 786a59d on 7.x-4.x, 8.x-1.x by ceng:
    Issue #809928 by ceng: Fix for back button not resetting autologout