Skip to content


ASP.NET StateServer and lost sessions in Web Garden

ASP.NET StateServer enables you to store session information outside of IIS worker process. This comes especially handy if you are running your application in a “web garden” scenario or a server farm. This means, that requests coming to your server do not have “process affinity” and are being handled by a random process in the web garden pool.

We were experiencing some weird issues with ASP.NET 1.1 application, where aspnet_state.exe service was running in .NET framework 2.0 context.

Some debugging and eavesdropping the communication channel between ASP.NET and StateServer revealed the cause. Each process has a unique, AutoGenerate-ed ID. So, in order to enable lookup of the same session key content for all processes running in webgarden (and even all of the machines in the webfarm, if you are running the same app on multiple servers), you must set the validationKey property in your web.config file.

Posted in general.