Click here to Skip to main content
15,885,366 members
Articles / Web Development / ASP.NET
Alternative
Tip/Trick

Session Expiry when browser window is closed

Rate me:
Please Sign up or sign in to vote.
1.83/5 (5 votes)
28 Feb 2011CPOL 12K   1   5
Following is a one line solution when it is written within Session_End() method of Global.asax file.Session.Abandon()HTH
Following is a one line solution when it is written within Session_End() method of Global.asax file.

VB
Session.Abandon()


HTH

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Comments and Discussions

 
GeneralSession.Abandon won't come into picture as the scene here is... Pin
rajivpande8613-Mar-11 14:53
rajivpande8613-Mar-11 14:53 
GeneralReason for my vote of 2 Focuses on an important issue, but o... Pin
apbruno8-Mar-11 7:30
apbruno8-Mar-11 7:30 
GeneralFrom : donmillaalex Cool, article. We were doing something ... Pin
Chris Maunder1-Mar-11 10:04
cofounderChris Maunder1-Mar-11 10:04 
GeneralReason for my vote of 1. This only works for In-Proc session... Pin
manish7623528-Feb-11 23:50
manish7623528-Feb-11 23:50 
GeneralReason for my vote of 4 Good one... Pin
Pravin Patil, Mumbai28-Feb-11 3:15
Pravin Patil, Mumbai28-Feb-11 3:15 
Reason for my vote of 4
Good one...

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.