Solved

Browser close

Posted on 2014-03-14
3
291 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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…
Introduction Chart.js, used properly, can visually add a difference to your charting applications. It engages your visitors and allows them to interact with data they otherwise wouldn't be able to without expensive and complicated systems. For this…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery including how to code hide show and toggles. 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…

863 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

Need Help in Real-Time?

Connect with top rated Experts

27 Experts available now in Live!

Get 1:1 Help Now