Solved

Expiring of Sessions in ASP.NET

Posted on 2004-10-13
8
414 Views
Last Modified: 2010-04-06
In ASP.NET after having set the Session timeout to 20 minutes, if the users close the browser window without logging out , is there a way to identify such clients from the Server without having to wait for 20 minutes and expiring those sessions?
0
Comment
Question by:ravisankar1978
8 Comments
 
LVL 6

Accepted Solution

by:
etmendz earned 100 total points
Comment Utility
The web is stateless. And because of that, the feature you want is not possible. Have fun...
0
 
LVL 2

Assisted Solution

by:AmanBrar
AmanBrar earned 100 total points
Comment Utility
There is no way to do that from a server.
Maybe u can do that in the application's unload function.
0
 
LVL 53

Assisted Solution

by:COBOLdinosaur
COBOLdinosaur earned 100 total points
Comment Utility
The only way to do it is with client side code.  You can use a hidden frame or iframe with a function that sends accross a refresh request on a regular basis; say every minute of 30 seconds.  When the refresh messages quit coming th user has move off with out logging off and you can expire the session.

Cd&
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 2

Assisted Solution

by:mikelima
mikelima earned 100 total points
Comment Utility
When drawing a page, pass a variable to it: if it is a form, include dynamically a hidden field called, for example, time, containing the hour when the page was dynamically drawn. If the page is not a form, pass a variable to it on the url (something like page.asp?time=1005.

At the beginning of all pages you want to expire, put a routine to verify the time on that variable with the time on server and expire it when desired.
0
 
LVL 2

Assisted Solution

by:poopall
poopall earned 100 total points
Comment Utility
Why dont you reduce the sesson time out to say 5 minutes, if they are using the site then the session will remain valid, if they stop using it they will have to login in again.



0
 
LVL 2

Expert Comment

by:poopall
Comment Utility
Another way would be for you to set up some client side javascript that acts like a hearbeat if the page is still loaded into the browser window, if the hear beat stops for that user, expire their login
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Shoutout to Emily Plummer (http://www.experts-exchange.com/members/eplummer26.html) for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

744 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

15 Experts available now in Live!

Get 1:1 Help Now