tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Terence M. Bandoian" <tere...@tmbsw.com>
Subject Detecting Expired Session via JavaScript?
Date Wed, 02 Dec 2015 21:39:38 GMT
On 12/1/2015 11:30 AM, Jerry Malcolm wrote:
> I'm looking for a way to detect that the current session has expired 
> (or logged out via another tab on the browser).  I know I could just 
> issue dummy requests to the server and see if a login page comes 
> back.  But issuing requests automatically resets the session timer. I 
> need a benign way to query that doesn't keep the session alive forever.
>
> I'm sure this problem has been solved before.  But basically, I want 
> to know that the session is no longer valid and force the user back to 
> the login page.  I know one possibility is to set the Tomcat timer to 
> 30 min expiration, and then keep a '29 minute' timer running in the 
> browser.  But my clients can change the tomcat session timer length.  
> And also this doesn't account for a logoff using the same session on a 
> different browser tab.  I'd really like a pro-active query method if 
> anything like that exists.
>
> Suggestion?
>
> Thanks.
>
> Jerry
>

One problem with checking the session status from the browser is time.  
A response may be received from the server that indicates the session 
has not expired BUT, the session may then expire before the next message 
is sent.

-Terence Bandoian


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message