且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

旧版(经典)ASP代码会话问题

更新时间:2023-09-21 13:15:52

请阅读以下内容,我认为它可以回答您的所有问题:

Please read this, I think it answers all your questions:

http://www.w3schools.com/ASP/asp_sessions.asp

乔治,

在服务器端有一个session_end事件,但是我想您想要在客户端检测到它.

There is a session_end event on the server side, but I suppose what you want is to detect it on client side.

为此,您必须在javascript上设置一个计时器,例如在会话超时前一分钟结束并弹出警报.警报使用户可以选择扩展会话.如果用户说是",那么您将张贴以下表格(或ajax调用或在服务器端生成请求并扩展会话的任何内容).

To do that, you must set a timer on javascript, to end for example one minute before the session timeout and popup an alert. The alert gives the user the choice to extend the session. If the user says yes, then you make a post of the form (or an ajax call or anything that generates a request on the server side and so extends the session).