how can I sync JS timeout and ASP.NET session timeout?
Ok. I can't really solve what I want - so if you can please advis开发者_Go百科e me on how to:
I have a page of each every click has ajax call to my server (hence, the ASP extends the session)
I have ASP.NET session set to Xmin. I want when X+1 min expires, I have expiration page. what I did was to set the JS timer to validate every x+1min to see if the session expired (the problem is that the JS and the ASP session timeouts are not synced)
how can I make them be synced?
every time you make an ajax call reset your timeout agian. so they will be synced...
I say that you can not absolute synchronized them because they run on 2 different computer that you can not control the one of them. So is better find other way to do what you try.
Here are similar links.
http://forums.asp.net/p/1207721/3094847.aspx
http://blogs.msdn.com/b/nikhiln/archive/2007/06/21/detecting-session-timeout-in-asp-net-2-0-web-applications.aspx
http://www.codeproject.com/KB/scripting/Session_Timeout.aspx
Get ASP.NET Session Last Access Time (or Time-to-Timeout)
精彩评论