July 8, 2010 by Christoff Truter ASP.NET IIS
Traditionally ASP sessions are dependent/bound to the process/machine that hosts it, which proves to be quite an annoying limitation - since whenever the process fails/recycles, or becomes unavailable (e.g. web server farm), session state is lost.
In ASP.net however, Microsoft added the ASP.net Session State Service in which they made it possible to move sessions outside the current process/machine - which means restarting/recycling a pool wont affect our sessions.
By default ASP.net sessions are still dependent/bound to the process/machine that hosts it, we need to enable/configure sessions to run out of process.
Lets have a look at how to do that.
First of all make sure that the ASP.Net State Service is started. (Generally its a good idea to set its
startup type to automatic)
Secondly within your web.config add/edit the sessionState node (located within the system.web node), like this:
<sessionState mode="StateServer" stateConnectionString="tcpip=localhost:42424" cookieless="false" timeout="20"/>
<sessionState mode="SQLServer" sqlConnectionString="Server=.\sqlexpress;User ID=username;Password=password" />
aspnet_regsql.exe -S .\sqlexpress -E -ssadd -sstype p
<sessionState mode="StateServer" stateConnectionString="tcpip=localhost:42424" cookieless="false" timeout="20" compressionEnabled="true" />
June 15, 2010
Encrypting your web.configJune 18, 2008