session timeout prompt asp.net
- by renathy
The application I am using is implementing some session timeout prompt using jquery. There is a timer that counts and if there is no user activity after predefined X minutes it shows user prompt
(Your session will end soon... Continue or Logout).
It uses the approach found here - http://www.codeproject.com/Articles/227382/Alert-Session-Time-out-in-ASP-Net.
However, this doesn't work if user opens new tab:
1) User logs in, timer starts counting user inactivity's.
2) User clicks some link that opens in new window (for example, in our case it is a long report running). Second tab is active, there is some response (crossbacks / postbacks that doesn't end session).
3) Second browser tab is active, there is some activity that doesn't end session.
4) However, first browser tab is inactive and counter is "thinking" that session should be closed, it displays appropriate message and then logout user.
This is not what we want. So the given approach is just some session timeout fix, but if user is active in another tab, then application will logout user anyway. That is not the desired thing.
We have a Report Page. It functions so that it opens report in a new tab/window. And it could be run quite long. Report section take care of some callbacks, so session wont end in this tab. However, it would end in the second tab.