This SharePoint tutorial, we will discuss how to fix error “Session state can only be used when enableSessionState is set to true” which comes in SharePoint 2010.
The full error message which comes as Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive. Please also make sure that System.Web.SessionStateModule or a custom session state module is included in the <configuration>\<system.web>\<httpModules> the section in the application configuration.
Session state can only be used when enableSessionState is set to true
We have to enable session state for the pages by adding enableSessionState=”true” in the page directives.
Then we need to modify in the web.config file like below:
Go to the <modules runAllManagedModulesForAllRequests=”true”>
Remove <remove name=”Session” />
And add the below line:
<add name=”Session” type=”System.Web.SessionState.SessionStateModule” preCondition=”” />
Now Save this and it should work fine.
Run the below PowerShell command:
You may like following SharePoint tutorials:
- SharePoint hosted app development tutorial
- Top 10 SharePoint development company in India
- How to disable mobile page redirection for SharePoint 2013?
- Excel cannot connect to the SharePoint list
- Attach workflow to content type in SharePoint 2010
- Apply HTML to SharePoint designer workflow email template
- Add or Remove blocked file types in SharePoint
- Get 4 part assembly name of a custom web part in SharePoint 2010
- How to stop workflow in SharePoint before less than 1 min?
- Download SharePoint Manager 2013/2010/2007/Online
- Too much customization in SharePoint injurious to health
I hope this SharePoint 2010 tutorial helps to solve Session state can only be used when enableSessionState is set to true error which comes in SharePoint 2010.
I am Bijay from Odisha, India. Currently working in my own venture TSInfo Technologies in Bangalore, India. I am Microsoft Office Servers and Services (SharePoint) MVP (5 times). I works in SharePoint 2016/2013/2010, SharePoint Online Office 365 etc. Check out My MVP Profile.. I also run popular SharePoint web site SPGuides.com
Download SharePoint Online Tutorial PDF FREE!
Get update on Webinars, video tutorials, training courses etc.