Steps to reproduce

  1. Create a javascript file containing a behavior which implements the window.onbeforeunload event.
  2. Access the page which the behavior applies and is executed and wait the logout time.

Actual result
Displays a modal dialog with a message and two buttons, OK and Cancel.
If the user clicks in OK, it is logged out from the site.
If the user clicks in Cancel, the user continues in the page. So, if user choose Cancel it is keep in the page instead to be logged out.

Expected result
The modal dialog should not be displayed and user must be logged out.

Proposed solution

This issue is caused because the autologout.js redirects the user to another page and the browser call on unload event verify if window.onbeforeunload event is implemented and fires the event when a window is about to unload its resources. The document is still visible and the event is still cancelable.

The fix is to before redirect the user to another page set NULL to the window.onbeforeunload event.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

vmachado created an issue. See original summary.

vmachado’s picture