Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Session Timeout starts count down after unlocking the screen on a mobile device #27

Open
b-barman opened this issue Mar 14, 2016 · 5 comments

Comments

@b-barman
Copy link

Example Configuration - session time out at 10 mins, count down timer to display set at 60 seconds.

Problem Scenario -
User is on a mobile device such as ipad and then leaves for some time say by locking the screen or the screen times out. Once the user comes back, if the session has already timed out and when ideally the user should have been taken to the logout screen, the modal window still shows up with the count down timer message and keeps showing it for about 5-10 seconds before taking the user to the logout screen.
This gives false impression to the user that he can extend the session and also is not an ideal UX.

@JillElaine
Copy link
Owner

Is the client's browser in a suspended state when the screen is locked?

@b-barman
Copy link
Author

Not sure if by suspended you meant if the browser was minimized or in the background but in my case, the browser was in the foreground, although I would like to know also how it would behave if it was in the back ground.

@JillElaine
Copy link
Owner

Because mobile devices use a battery, apps may be suspended when not in use to save battery power. Not sure how to continue to have an idletimer check for idleness or redirect to a log out page when the browser is suspended.

http://stackoverflow.com/questions/6543325/what-happens-to-javascript-execution-settimeout-etc-when-iphone-android-goes

http://www.makeuseof.com/answers/apps-webpages-always-reload-multi-tasking-ipad-2/

@b-barman
Copy link
Author

So would it be fair to say that for mobile browsers we need another mechanism may be cookies or something similar to track the suspended state?

@JillElaine
Copy link
Owner

Apparently there are methods to determine if a mobile browser has returned from or is about to go into a suspended state. Which method to use depends on the iOS of the device, I think?

Here is one method that may work for some devices:
http://docs.phonegap.com/en/4.0.0/cordova_events_events.md.html

document.addEventListener("resume", onResume, false);

function onResume() {
    // Handle the resume event
    logoutUser();
}

Perhaps you could test this? I do not have a mobile device of any kind, sorry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants