Tuesday 12 June 2007

IIS6 app pools and session state

We've intermittently been having some sessions dropping on various web sites, after about 20mins (umm sounds familiar that value...), despite having session timeout settings of say 2 hours in our web app config files (both ASP and ASP.net). After some digging, I came across this:

http://blogs.msdn.com/david.wang/archive/2005/09/19/Why_do_I_lose_ASP_Session_State_on_IIS6.aspx

If you use in-proc session state (which is the default and very popular), your application pool's "shut down worker process after being idle" setting in IIS6 is likely to be 20 mins. Thus ignoring your web app config setting if your application pool is *idle* for 20 mins or more.

Easiest solution is to increase this idle timeout value. The other option is to store state out of process.

No comments: