ASP.NET session state and multiple worker processes ASP.NET session state and multiple worker processes asp.net asp.net

ASP.NET session state and multiple worker processes


Having multiple worker processes and using InProc does not seem to be compatible.

See this:

If you enable Web-garden mode by setting the webGarden attribute to true in the processModel element of the application's Web.config file, do not use InProc session state mode. If you do, data loss can occur if different requests for the same session are served by different worker processes.


More than one worker process is a "web garden." In-process session state will not work correctly. You'll need to use either a single worker process for your web app, or use a session state server, or SQL Server for session state.


I may be wrong, but as far as I know, by default you only have 1 worker process per application domain with multiple worker threads to handle requests. In this case In-Proc Session State should work just fine (the default settings).

But if you do have multiple worker processes (not just worker threads, actual worker processes) you do need out of process session state.

I think having more than 1 worker process in ASP.NET is referred to web garden mode which you have to specifically enable and if you do, then you need out of process state management. See the comment box on this page under the In-Process Mode heading.