Solved

Browser close

Posted on 2014-03-14
3
293 Views
Last Modified: 2014-03-18
Hi Experts,

I am facing interesting phenomena when I have login page [.net aspx] and user logs into system.
Then user closes the whole browser window [not just one or two tabs]
Then user opens browser again and you can see you page again as you are logged in and never left it.

I am not using caching although I do use authenticated cookie.

My question is how to avoid if window been closed and opened to treat user as logged in ?

I have some code on unload and before unload as well clearing all cookies ans session data.

How its possible ?

Thanks.
0
Comment
Question by:fpoyavo
3 Comments
 
LVL 62

Expert Comment

by:Fernando Soto
ID: 39930323
Hi fpoyavo;

Please have a look at the article below.

CodeSnip: Handle Browser Close Event on the Server-Side
0
 
LVL 82

Accepted Solution

by:
leakim971 earned 500 total points
ID: 39930329
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39930361
If the user has set their browser to open the last page (or pages) from the previous browser session, that is probably coming from the browser cache and not your server.  Session cookies should expire when the browser and ALL of it's windows are closed.  If even one window is left open, the session cookies do not expire.  

'on unload' and 'before unload' can not be counted on.  If the power goes out, you are likely to see the same phenomena.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are a couple ways to attach a JavaScript function to dynamically created elements. You can make a new script for each element as it’s created or you can use delegation. Delegation allows a single script that is added at page creation to mat…
PROBLEM: The other day I was working on adding an ajax request to a webpage that already had a dialog box on the page.  The dialog box was using relative positioning to be positioned next to a form field I had on the page.  Everything was working…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question