Session handling on IIS

Categories Web HostingScriptingASP.NET

ASP.NET users on Windows IIS servers are provided with an easy option for session data externalisation, a session state server. This server stores client session information separate from the IIS cluster, therefore sessions are maintained when visitors to your site are directed to a different IIS webservers by our load balancers.

Server hostname: 
web.config settings:

<sessionState mode="StateServer" stateConnectionString=""/>

Note: All objects stored in the session must be serialisable. The Microsoft Help and Support pages contain additional troubleshooting for any errors you may incur when using the session state server.

Problems with saving of session data?

Errors such as "Validation of viewstate MAC failed" are not uncommon with Session management. If you're experiencing problems using the session state server after adding the above configuration details into your web.config file, it is probably because your application requires you to set a unique Validation Key. Please see Creating a MachineKey for your .NET application for full details.

Rate this article
Get more leads