State Server mode in ASP.NET

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.

Getting Started

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:



<sessionState mode="StateServer"






code state Server mode in asp arvixe web hosting

Objects stored in session state must be serializable if the mode is set to StateServer.

Information about availability on our servers:

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

Looking for quality Windows Hosting? Look no further than Arvixe Web Hosting!

Happy Hosting!

Rodolfo Hernandez

Tags: , , , , , , , , , , , | Posted under ASP .NET 2, ASP .NET 3.5, ASP .NET 4.0 | RSS 2.0

Author Spotlight

Rodolfo Hernandez

I like photography and reading books. Currently working for Arvixe as Elgg Community Liaison. Elgg Security Expert Web Security Expert CEO of UDP SW Social Web

2 Comments on State Server mode in ASP.NET

  1. Tory says:

    UPDATE 2015: I believe cookieless=”false: has been replaced with cookieless=”UseCookies” if user is deploying with Net 4.0 and above.

    • You are correct. This boolean mode “true” or “false” was probably deprecated

      So if “false” and “true” values still work nowdays (for .NET framework 2.0 and above) I guess when you set “false” it assumes that will be used cookies for storing session identifier as UseCookies and “true” will assume that you don’t want to store cookies as UseUri. I will write an update this month.

Leave a Reply

Your email address will not be published. Required fields are marked *