2010-06-25 73 views
0
On windows authentication(intranet web application) 
    When the session is about to timeout, the client should be presented with a POP-UP that asks to click OK to extend the session or else cancel to timeout the session. 

哪个更好的方式来完成这项任务。 通过使用Ajax调用或通过在会话(用户标识符)不是空的时候在文件后面的代码中处理它会话时间延长

回答

2

您可以简单地在您的页面上使用javascript提示用户按下ok键重置会话的滑动过期窗口。如果他们按是,那么只需发送离散的http请求到服务器端,以便重置会话持续时间窗口。至于什么时候显示弹出窗口,我会说好几分钟才会过期以保证安全。

有关如何保持会话结束的信息,请参阅以下stackoverflow帖子。然后你只需实现你的javascript对话框来支持/调用这个例子。

Keeping ASP.NET Session Open/Alive