惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
The Blog of Author Tim Ferriss
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
云风的 BLOG
云风的 BLOG
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
P
Palo Alto Networks Blog
D
Docker
H
Hackread – Cybersecurity News, Data Breaches, AI and More
S
Schneier on Security
Engineering at Meta
Engineering at Meta
I
InfoQ
L
LangChain Blog
Cyberwarzone
Cyberwarzone
T
Tenable Blog
WordPress大学
WordPress大学
P
Privacy & Cybersecurity Law Blog
罗磊的独立博客
Apple Machine Learning Research
Apple Machine Learning Research
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Jina AI
Jina AI
C
CERT Recently Published Vulnerability Notes
Scott Helme
Scott Helme
博客园 - 三生石上(FineUI控件)
酷 壳 – CoolShell
酷 壳 – CoolShell
Know Your Adversary
Know Your Adversary
D
Darknet – Hacking Tools, Hacker News & Cyber Security
The Last Watchdog
The Last Watchdog
Last Week in AI
Last Week in AI
Cloudbric
Cloudbric
S
SegmentFault 最新的问题
爱范儿
爱范儿
Application and Cybersecurity Blog
Application and Cybersecurity Blog
博客园 - 叶小钗
AI
AI
T
Tor Project blog
I
Intezer
T
Threatpost
www.infosecurity-magazine.com
www.infosecurity-magazine.com
V
Visual Studio Blog
N
News and Events Feed by Topic
Latest news
Latest news
S
Security Affairs
博客园 - Franky
Microsoft Security Blog
Microsoft Security Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
B
Blog RSS Feed
C
Cybersecurity and Infrastructure Security Agency CISA
Hugging Face - Blog
Hugging Face - Blog
小众软件
小众软件
S
Securelist

博客园 - davidullua

Google chrome的离线安装版 百度进军B2C行业 File Comparer - To compare two files and check whether they have the same content No size set for variable length data type: String Response.WriteFile()下载文件,打开对话框出现两次 - davidullua - 博客园 to create table if table do not exist -- to backup and restore table in oracle Gmail邀请 When Session_End() and Session_Start() Fires about Ora-03114 disable asp.net connection pool(pooling) Oracle FAQ: 未在本地计算机上注册"OraOLEDB.Oracle"提供程序 (The 'OraOLEDB.Oracle' provider is not registered on the local machine) solution - davidullua ora-00054 , alter system kill session 'id,serial#' Change Path of C:\Documents and Settings - davidullua About FormsAuthentication.RedirectFromLoginPage(string username, bool createPersistentCookie) Send email by jmail or CDO according to configuration C#中调用控件的事件 [导入]C#向Sql Server中插入记录时单引号的处理 [导入]C#使用CDO发送邮件 [导入]使用jmail组件发送电子邮件(C#) [导入]C#中使用反射显示程序集的所有类型和属性 [导入]使用Oracle Developer Tools For Visual Studio .NET
to call Session_End() event when user closed Browser
davidullua · 2005-09-21 · via 博客园 - davidullua

There is no event in the Global.asax to deal with browser closing. When we need to call Session_End() upon user close the browser. We can use a indirect way to call Session_End() to do some clearance jobs. Actually, we do not need to call Session_End() to do some clearance jobs upon closing browser in client.


Here's the steps:

1). to catch browser cloing event in .aspx page, simply, just add onbeforeunload event to the <body > tag.

<body onbeforeunload= 'CloseWindow();' >

</body>

2. In the head of .aspx page, add the following code to load another page to do clearance jobs. In the following codes, it would transfer to clearance.aspx page, and in the Page_Load() of clearance.aspx, we could do clearance job, or fire the Session_End() event by abandon Session.


<script language ="javascript">function CloseWindow()
{
window.location = '../clearance.aspx';
alert('You are about to close the window');
}

</script>

3.in the Page_Load() of Clearance.aspx, add the following code to fireup Session_End() or do clearance(Attention, make sure your web application is in the In-Proc Session mode, web.config use In-Proc Session mode by default).

HttpContext.Current.Session.Abandon();

// to do clearance bellow:

// ...

Reference:
http://gridviewguy.com/ArticleDetails.aspx?articleID=108