Solved

Expiring of Sessions in ASP.NET

Posted on 2004-10-13
8
422 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
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 100 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 100 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
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 2

Assisted Solution

by:mikelima
mikelima earned 100 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 100 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
XSLT 5 47
how to extract window origin in spring 2 74
Coova-Chilli can't work with URL using HTTPS! 3 270
Having Returning  Anonymous Function Access Global Function 7 99
When you work with shopping cart / ecommerce relates web sites, you need to pass the certain form post details to the payment gateway process page with required details for the products items you give to order. Also you may need to track the ordered…
Most of the sites are being standardized with W3C Web Standards. W3C provides lot of web standard services to the web. They have the web specification, process and documentation for all the web standards. You can apply HTML, CSS and Accessibility st…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
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)

839 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