Click here to Skip to main content
14,969,978 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear All

I want to kill user session when user close browser through Alt+F4 OR Close Window option + File Menu - > Exit option etc
Posted

This[^] and this[^].


It's the first point in the guidelines on the right hand side when you ask questions.
   
maybe this can help you!

0) use a script to detect window closing event (use lib or your own).
1) and add you custom Ajax code to sent query to your page that kill session.

example (javascript code):
<script type="text/javascript">
        window.onunload = function() {
            alert("Here Ajax Code to page killsession.aspx");
        };
    </script>


example (killsession.aspx page):
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Session.Abandon()
    End Sub
   

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




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900