Click here to Skip to main content
15,884,472 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello all :)

I used sessions at old web site to save log in data, is there a way to make user logged out after closing the browser ?


thanks in advance :)
Posted
Updated 12-Jan-13 15:20pm
v2
Comments
Sergey Alexandrovich Kryukov 12-Jan-13 21:26pm    
"After closing the browser" is obviously too late to do anything. :-)
Just before closing the window is possible, but you cannot rely on it.
—SA
shaikh-adil 13-Jan-13 5:26am    
sir can you help me out here
http://www.codeproject.com/Questions/526995/changingplusthepluscurrentpluscellplusselectionplu

1 solution

Try with window.onbeforeunload java script event. It will fire before closing the browser. you can use that event to call the ajax request to force session out or redirect to the logged out page.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 13-Jan-13 12:45pm    
This is correct, my 5. (I disagree with the vote of 2. At least it would need some explanation.)
—SA

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