Is there any way to detect session timeout without (user interaction)*, and redirect it to some page; i.e. if there is no activity on page @ specific duration; server detects it and redirect it automatically on some other.
By user user interaction I mean; there is a way to detect session timeout when user clicks on something, then some request goes to server and then server checks if current user session is expired or not.
What I need here is that we don’t inform server anything (or we don’t perform any action), but when session expires server detects it automatically and perform required action.
Thanks,
Raza
You can of course do such a thing in JavaScript by implementing a document-wide keyboard and / or mouse listener and a periodical method with a timeout.
now your global listeners just have to set lastActivity to the current time on every action.
On re-reading the question, you want to use the actual session timeout from the application server. That’s a tough one, because your when you send ajax requests to the server you will actually keep the session from expiring (unless there is a hard limit), so my answer might still be the best way to do it.