1
votes

I have an asp.net application in IIS 5.0(windows 2000 server), my application is working with windows authentication and I have set the timeout as 120 min. Say the user starts working from 11:00 and the user is working on the application but after about 2 hrs i.e. about 13:00 the session timeout unexpectedly even though user is working on it. I modified the timeout to 300 min now the session stays active for about 5hrs and disconnects unexpectdly even thow user is still working. I have the web.config file as below.

<authentication mode="Windows"/>
 <sessionState timeout="120">

also checked the asp.net session timeout in the virtual directory properties which is the same 120 min.

Any taught or solution will be very helpful.

4
120 minutes is 2 hours - so define "user is working on it", the session should reset each time there is a postback so is the user doing something that posts back to the server? It seems like an obvious question but I've had users walk away from a page for significantly upwards of 20 minutes (default session timeout) and be surprised that its not working when they come back...Murph
Any chance that something is modifying the web.config / bin directory causing the application to recycle?Jagmag
Are you on shared hosting? E.g. discountasp will put your app to sleep if nothing happens for a certain period of timePleun

4 Answers

2
votes

If you use InProc Session State mode, all session information can be lost at any time regardless of the timeout parameter if the application pool is recycled, which can happen at any time for different reasons.

I would change to one of the Out Of Proc Session State modes, if you can.

Check these links:

asp.net inproc vs out of proc performance

http://www.hanselman.com/blog/TroubleshootingExpiredASPNETSessionStateAndYourOptions.aspx

1
votes

Timeout in my case was because the session was not ended properly when the user disconnects unexpectedly. When the user connects the next time this was causing some timeout problem. After closing the sessions properly it works fine

1
votes

Had this same issue. My case wasnt the timout in sessionState

<sessionState mode="InProc" timeout="5" />

it was forms timeout

<authentication mode="Forms">
  <forms loginUrl="~/" slidingExpiration="true" timeout="5" />
</authentication>

I set the timeout in forms to 120(2 hours) and its working

<authentication mode="Forms">
  <forms loginUrl="~/" slidingExpiration="true" timeout="120" />
</authentication>
0
votes

Did you check the application pool time out?

IIS -> application pools -> select pool -> Advanced settings -> section "process model" => Idle Time-out(minutes)