January 26th, 2007, 06:39 PM
Losing Session Var's before timeout
I have been running into a problem with a web app that loses it's session.var's long before the session timeout value is up. It doesn't happen consistently, so it has been hard to track down the reason why.
Code is ASP
Server Win 2000
Please let me know if there is any other info that would help.
January 26th, 2007, 06:47 PM
Start> All Programs>Administrative Tools > Internet Information Services (IIS) Manager
Rightclick the virtual server you want to configure..then click Properties>Web Site tab.
Connections.... in the Connection timeout box......Default is 120 second (2 mins)
How people treat you is their karma- how you react is yours-Wayne Dyer
January 26th, 2007, 07:02 PM
Currently set to 900 sec (15 Min)
January 26th, 2007, 07:28 PM
Session timeout can also be set on a per-session basis in the application, and there are other reasons for sessions timing out.
In ASP-classic (Which I assume is what you're referring to), sessions are held in memory in the space of the web application. In the event that the web application is reset, all sessions are wiped (This is determined by IIS seemingly arbitrarily, but may be affected by use of IIS manager or scripts modifying the metabase with ADSI).
In ASP there is no provision for retaining session data across IIS application resets (e.g. machine reboot, IIS service restart, or IIS just resetting the application because it feels like it).
If you're on shared hosting, you will find this unmanageable, as the hosting provider will doubtless use scripts which poke ADSI in ways which cause IIS resets at unpredictable regular intervals.
Another possible cause of IIS resetting is that it's crashing. If that happens, evidence should be visible on the NT error log.
January 27th, 2007, 12:52 AM
What we do is to do the following before any code in the asp page:
This explicitly tells it to hold sessions for so long. Ihave never run into a problem with asp handling session vars or just "loosing" them.
Try that and see what happens.
January 29th, 2007, 07:57 PM
Thanks xmaddness. I updated all of my asp code, and so far so good.