Home » IIS » How to use State Server for storing SSRS session info

How to use State Server for storing SSRS session info

If you are hosting SSRS environment on multiple IIS servers, you will need to use a common State Server or SQL Server to store session data. In this post, I will share some tips about this scenario.

How to use State Server for storing SSRS session info

Please note that using In-Process mode or using State Server Mode in the server itself will cause session errors such as “ASP.NET Session has expired

Tips to avoid “ASP.NET Session has expired” and other session issues

In the web.config file:

  • Make sure to set enableSessionState to True. Example:
<pages buffer="true" validateRequest="true" enableSessionState="false" enableViewState="true" viewStateEncryptionMode="Always" controlRenderingCompatibilityVersion="4.0" clientIDMode="AutoID">
  • Make sure that Session State is not disabled in individual pages. If there is enableSessionState parameter in the Page directive, it should be set to True. Example:
<%@Page enableSessionState="true"> 
  • Make sure there is stateConnectionString defined in the. IIS servers should point to a common server to store session information. A sample for the correct definition:
<sessionState mode="StateServer" stateConnectionString="tcpip=SampleStateServer:42424" cookieless="false" timeout="20"/>
  • In order to set up a separate server as State Server, install .NET Framework and set the registry key below to “1”. Make sure that ASP.NET State Service is running.


Once you implement the session state mode correctly, you may run into another issue which is generating a new session ID in every postback. Here is the solution: ASP.NET application generates a new session ID after every postbacks

Ned Sahin

Blogger for 20 years. Former Microsoft Engineer. Author of six books. I love creating helpful content and sharing with the world. Reach me out for any questions or feedback.

Leave a Comment