1

Possible Duplicate:
How can I override the OnBeforeUnload dialog and replace it with my own?
destroy session on window close?
How to execute ajax function onbeforeunload?

i want to delete the session after user close window . i don't know how to do this . please help me . i tried following code its working fine IE browser but not working in other browsers . is there any other way to solve this problem

$(window).unload( function (event) 
{ 
     if (window.event.clientX < 0 && window.event.clientY < 0)
     {
     alert("closeddddddddddd");
     $.ajax({ url: "logout.php"});
     }
 } );
Community
  • 1
  • 1
  • I think if you close your browser, the session will automatically cleared, am I right? – SuperNoob Apr 17 '12 at 06:32
  • but in a limited time i want to get immediate logged out because iam making a chat application and in this if user is closing that window than it should be reflect in my database – jeetendra singh Apr 17 '12 at 06:45

0 Answers0