当 asp.net 应用程序中的会话超时时,我们需要关闭用户已经打开的所有网页。
每个页面都有退出链接。当用户单击该链接时,主页将被重定向到该页面。
在这种情况下,其他打开的页面也需要关闭。
我们应该怎么做?
当 asp.net 应用程序中的会话超时时,我们需要关闭用户已经打开的所有网页。
每个页面都有退出链接。当用户单击该链接时,主页将被重定向到该页面。
在这种情况下,其他打开的页面也需要关闭。
我们应该怎么做?
对于所有页面:
On the second thought... we can use what @thephpdeveloper said, particularly when user signs out formally... (like clicking the signout button) Once After a formal Sign out happens... Such Ajax Call back can be used, cause the session will be valid but there will not be any user... Using this we can signal the page and close the browser window
正如 Razzie 评论的那样,对同一个 Web 应用程序执行 AJAX 回调将使会话保持活动状态。使用网络服务也不能解决问题。
此解决方案避免保持会话活动:
Session_Start
时Global.asax
或登录后完成。Session_End
在文件中的事件中Global.asax
或注销后从数据库中删除超时会话。我建议您使用 SessionID 来识别会话。