I set session timeout to be 5 minutes in web.xml. And once session expired sessionDestroyed() will be executed.
But I want session to be alive as long as browser window is still there. So in each JSP page there is a piece of JavaScript code that visits an image on the server every 100 seconds. Basic idea regarding this part can be found at
http://www.intelliproject.net/articles/showArticle/index/js_session_expired
However, the sessionDestroyed() will still be executed in 5 minutes. Here is my question, why sessionTimeout event is triggered even though I keep visiting it every 100 seconds?
Using firebug, open the net tab and watch for the javascript request. You should be receiving
HTTP 200for each image GET, and each url should have random numbers appended to the end. You should probably just use a timestamp, rather than random numbers, as random numbers might eventually repeat and log the user out.Do you have an example page where this is happening?