Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.
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> section in the application configuration. 

I have set it to true but still get the above error!

 <pages enableSessionState="true" enableViewState="true" enableViewStateMac="true"
 validateRequest="true" 
 pageParserFilterType="Microsoft.SharePoint.ApplicationRuntime.SPPageParserFilter, 
 Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, 
 PublicKeyToken=71e9bce111e9429c" asyncTimeout="7">
share|improve this question

2 Answers 2

If your modules section contains this element:

<remove name="Session" />

Comment or delete it, This should solve the problem.

share|improve this answer

It's not enough to put it on the page directive.

ASP.NET session state service is automatically disabled in normal installations of SharePoint (2007/2010).

You'll need to make sure that the service is activated and your web.config is configured properly eg:

<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"> 

Within the Central Administration, you also need to activate it if you're running SP2007 or through PowerShell if it's 2010 (Enable-SPSessionStateService and Highly trusted SharePoint Expert Nik Patel has a detailed walkthrough over here : http://nikspatel.wordpress.com/2012/02/12/enable-asp-net-session-state-on-sharepoint-2010-application/

Finally SharePoint is usually used with multiple WFE so make sure that you know what sticky session means and that your load balancer is handling it if you have more than 1 WFE.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.