StateServer mode ensures that session state is preserved if the Web application is restarted and also makes session state available to multiple Web servers. In this article I will give you a step-by-step guide on how to use State Server Mode in your ASP applications.
StateServer mode stores session state in a process, that is regerred to as the the ASP.NET state service, It’s independent of the ASP.NET worker process or IIS application pool.
How to implement the state Server mode?
First, you must ensure that the service is running ASP.NET state services on the server that choose to store the sessions.
You must to set this on the web.config of your application:
- Set the mode attribute of the sessionState element to StateServer.
- Set the stateConnectionString attribute to tcpip=serverName:42424.
This example shows a configuration for StateServer mode:
<configuration> <system.web> <sessionState mode="StateServer" stateConnectionString="tcpip=SampleStateServer:42424" cookieless="false" timeout="20"/> </system.web> </configuration>
Objects stored in session state must be serializable if the mode is set to StateServer.
Information about availability on our servers: https://support.arvixe.com/index.php?/Knowledgebase/Article/View/143/11/aspnet-session-state
In conclusion, this session state mode allows session state will remain active if the application is restarted and make it available to multiple servers in a Web farm.
This concludes State Server mode in ASP.NET