Handling session error on multiple frontend servers in ASP.NET 4.0

Perform the following steps to handle Session for Multiple Front End Servers

1) Add the tag under tag in the web.config file of all the front end servers

For Example:

<sessionState mode="StateServer" timeout="20" stateConnectionString="tcpip=server:port" />

Refer the following link for more information:

http://msdn.microsoft.com/en-us/library/h6bb9cz9(v=vs.100).aspx

2) Add the tag under tag in the web.config file of all the front end servers

The machine key can be generated from the following link:

http://aspnetresources.com/tools/machineKey

For Example:

<machineKey validationKey="41C11977666D4433D736559D3479711373A51E1F53161F81718B466B08AA23A48E45CF6F897C38F233C7A2A5A4C5754B73C53CF8A438417DFECE5EF2A63C1B82" decryptionKey="C13134ECD5DA5A8CBBE8FF0A0DCD973783B311C01ACBFD152F04DEBDA51613CB" validation="SHA1" decryption="AES" />

3) Start the ASP.NET State Service from “services.msc” and ensure that the client and server ports are the same.

If the server is on a remote machine, please ensure that it accepts remote requests by checking the value of HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\aspnet_state\Parameters\AllowRemoteConnection.

If the server is on the local machine, and if the above mentioned registry value does not exist or is set to 0, then the state server connection string must use either ‘localhost’ or ‘127.0.0.1’ as the server name.

Comments are closed.