Click here to Skip to main content
16,017,296 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
With hi
I wrote a script and when I shut herself user page automatically unset all session I do this I wrote this code
JavaScript
<script type="text/javascript">
var logout = function() {
    var xhr = new XMLHttpRequest;
    xhr.open("GET", "logout.php", false);
    xhr.send(null);
};

var winNumber=1;
window.onload = function() {
   winNumber=winNumber+1;
};

window.onbeforeunload = function() {
    winNumber=winNumber-1;

    if (winNumber === 1) {
        logout();
    }
};
</script> 


Here is my issue with the screen refresh time of session gone if I want to happen just after the closing of this page
Posted
Comments
Uday P.Singh 1-Dec-11 11:45am    
not clear, what are you trying to do?

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