dcsimg
detect session timeout without extending it
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Shane_Ye
Posted On:   Friday, June 16, 2006 02:45 PM

I am using Javascript to reload a servlet every 1 min to detect if session times out which was set to be 5 mins. This works fine when running this detection servlet after session is expired. However when session is still valid (say 2 mins to expire) and this detection servlet is called, session actually gets extended (now it's 5 mins to expire again). so session will never expire. What I am trying to do is to redirect user to login page when or shortly after session is timeout. I did saw some posts suggesting to use HttpSessionListener. It certainly can add things to do in method sessionDestroyed(), but I don't see how to redirect user to any page from sessionDestroyed(). Please help. Thanks    More>>

I am using Javascript to reload a servlet every 1 min to detect if session times out which was set to be 5 mins.
This works fine when running this detection servlet after session is expired. However when session is still valid (say 2 mins to expire) and this detection servlet is called, session actually gets extended (now it's 5 mins to expire again).
so session will never expire.

What I am trying to do is to redirect user to login page when or shortly after session is timeout.

I did saw some posts suggesting to use HttpSessionListener. It certainly can add things to do in method sessionDestroyed(), but I don't see how to redirect user to any page from sessionDestroyed().

Please help. Thanks

   <<Less
About | Sitemap | Contact