asp.netasp.net-mvcsessioniis-7worker-process

IIS 7 Application Pool work process life and Session life


In IIS7 Application Pool there is a setting Idle-time out default is 20 min, which says:

Amount of time(in minutes) a worker process will remain idle before it shuts down, A worker process is idle if it is not processing requests and no new requests are received.

My question is, if the worker process shut down because of the time-out time, does the session created by application which is hosted in this worker process get lost?


Solution

  • Yes -- the session data is tied to the app pool worker process, so once the worker gets shut down, the session data is lost.

    The default behavior is to store session variables in the memory space of the ASP.NET worker process.

    (Of course, this assumes you're using InProc as the session mode. If you're using the database, then it will persist after the worker gets shut down.)