Client-side session timeout redirect in ASP.Net

Posted by Mercury821 on Stack Overflow See other posts from Stack Overflow or by Mercury821
Published on 2010-05-17T19:28:05Z Indexed on 2010/05/17 19:30 UTC
Read the original article Hit count: 241

I want to build a way to automatically redirect users to Timeout.aspx when their session expires due to inactivity. My application uses forms authentication and relies heavily on update panels within the same aspx page for user interaction, so I don't want to simply redirect after a page-level timer expires. For the same reason, I can't use '<meta http-equiv="refresh"/>'

What I want to do is create a simple ajax web service with a method called IsSessionTimedOut(), that simply returns a boolean. I will use a javascript timer to periodically call the method, and if it returns true, then redirect to Timeout.aspx. However, I don't want calling this method to reset the session timeout timer, or the session would never time out because of the service call. Is there a clean way to avoid this catch-22? Hopefully there is an easy solution that has so far eluded me.

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about forms-authentication