开发者

how can I sync JS timeout and ASP.NET session timeout?

开发者 https://www.devze.com 2023-01-09 03:04 出处:网络
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)

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)

0

精彩评论

暂无评论...
验证码 换一张
取 消