Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET
Hello all Smile | :)
 
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 Smile | :)
Posted 12-Jan-13 14:45pm
Edited 12-Jan-13 16:20pm
v2
Comments
Sergey Alexandrovich Kryukov at 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 at 13-Jan-13 5:26am
   
sir can you help me out here
http://www.codeproject.com/Questions/526995/changingplusthepluscurrentpluscellplusselectionplu

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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.
  Permalink  
Comments
Sergey Alexandrovich Kryukov at 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)

  Print Answers RSS
0 OriginalGriff 290
1 Jochen Arndt 150
2 Kornfeld Eliyahu Peter 149
3 PIEBALDconsult 110
4 Richard MacCutchan 105
0 OriginalGriff 6,080
1 DamithSL 4,648
2 Maciej Los 4,087
3 Kornfeld Eliyahu Peter 3,624
4 Sergey Alexandrovich Kryukov 3,294


Advertise | Privacy | Mobile
Web02 | 2.8.141220.1 | Last Updated 12 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100