Reputation: 1992
We have a ASP.Net MVC Web Application that keeps timing out after exactly 30 minutes.
In the web.config, I set the sessionState timeout value to 500 minutes. After 30 minutes, the session still times out. So, I set it to 1 minute, which actually works. The session times out after exactly 1 minute.
Then, I added the following code to Session_Start in Global.asax.cs:
Session.Timeout = 500;
This effectively overrode the 1 minute timeout setting in the web.config. But, like clockwork, the session still timed out at exactly 30 minutes.
What can I do to make IIS honor the Session Timeout value?
Upvotes: 2
Views: 8866
Reputation: 39807
It sounds to me that your application pool is recycling after 30 minutes, which effectively kills all in memory sessions in IIS.
Below is some more information around the app pool recycling, how you can control it and also log those events.
http://www.iis.net/configreference/system.applicationhost/applicationpools/add/recycling
http://forums.asp.net/t/1663248.aspx/1
Upvotes: 3