IIS 7 Application Pool work process life and Sessi

2019-05-10 10:55发布

问题:

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?

回答1:

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.)