Enable Session State in SharePoint

This service is automatically disabled in normal installations of SharePoint 2010.It can be enabled using the instructions below.

To resolve the error and to enable session state for SharePoint there are two entries that need to exist in the web.config file.

The first is to ensure that enableSessionState is set to TRUE.
 
<pages enableSessionState="true" enableViewState="true" enableViewStateMac="true" validateRequest="false" pageParserFilterType="Microsoft.SharePoint.ApplicationRuntime.SPPageParserFilter, Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" asyncTimeout="7">
 
 The second is to ensure that the remove and add lines exist in the modules section for Session.
  1. <modules runAllManagedModulesForAllRequests="true">   
  2. …      
  3. <remove name="Session" />      
  4. <add name="Session" type="System.Web.SessionState.SessionStateModule" preCondition="" />      
  5. …      
  6. modules>  

Once you have made the modifications above to the web.config file you need to ensure that the State Service service application is running. You can check the status of this through Central Administation.

The error should now go away and Session State should be enabled for your web application.

Ebook Download
View all
Learn
View all