如何在用户关闭布劳尔没有注销终止会话 [英] how to kill the session when user closed the brower without logout

查看:93
本文介绍了如何在用户关闭布劳尔没有注销终止会话的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在开发One ASPNET应用我使用的会话。如果用户登录到应用程序,然后单击注销我在这里闭幕会议。

I am developing one aspnet application in that i am using Sessions. if user login into the application and click on logout here i am closing session.

假设如果用户没有在注销点击他关闭浏览器。如何在用户关闭布劳尔没有注销终止会话

suppose if the user doesn't click on the logout and he close the browser. how to kill the session when user closed the brower without logout

问候
库马尔

推荐答案

非常艰巨的任务:


  • 使用非常smalll超时节/你将有到期/

  • use sessions with very smalll timeout /you will have expiration/

使用隐藏脚本/ iframe来ping主机/你将有连接/

use hidden script/iframe to ping server /you will have connection/

手柄onunload事件窗口/可以绕过/

handle onunload event in window /can be bypassed/

代码示例:

window.onunload = function ()  
{    
    if((window.event.clientX<0) && (window.event.clientY<0)) {

       window.open("logoff.aspx");                  
    }    
}

这篇关于如何在用户关闭布劳尔没有注销终止会话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆