Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

State Server, Sessions, and Timeout

Status
Not open for further replies.

ryebread

Programmer
Aug 13, 2001
29
US
My ASP.net application involves limiting clients to a maximum number of concurrent logins. I have done this by storing the session id in a 'Shared' object property. I then depend on the session id to be removed when users log out, closes the window, or has a session timeout. Life was good untill I started testing timeout.

I had planned on using the Session_End function in Global.asax to remove the expired sessionid from my shared object when timeout occurs. However this will only work when sessions are in 'inProc' mode. For other issues we had to have session run out of process with the state server. So I hope to use the login functionality to poll the validity of the stored session ids and remove the ones that have exipired.

How can I find out if a session has expired by only knowing the session id?



 
rye: certainly no expert at Session State but couldn't you just check to see if the Session ID Isnull? and if so, assume the Session has timed out?
 
Isadore, thank you for your reply.

Yes, if I was in the current session. The stored session ids are from sessions from other users. So when a new user would login they would have a new session. It is during this login process where I would need to check to see if the session ids from other sessions are still active.
 
rye: will be back at the office tonite; will look into my references and see if I can't dig something up on this.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top