Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Expiring of Sessions in ASP.NET

Posted on 2004-10-13
8
Medium Priority
?
432 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 6

Accepted Solution

by:
etmendz earned 400 total points
ID: 12296140
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 400 total points
ID: 12297146
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 400 total points
ID: 12297534
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 2

Assisted Solution

by:mikelima
mikelima earned 400 total points
ID: 12311465
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 400 total points
ID: 12336449
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
ID: 12336451
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

It's sometimes a bit tricky to use date functions in Oracle BPEL. I'll explain quickly how you can add N days to the current date. In a BPEL process this can be useful, and you can adapt it to fit your needs. First of all, let's see how to add 1 …
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL several years ago, it seemed like now was a good time to update it for object-oriented PHP.  This article does that, replacing as much as possible the pr…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

609 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