Wednesday, May 30, 2012

Enable SessionState in Sharepoint

1) Open SharePoint 2010 Management Shell (As Administrator) and type the following command:

Enable-SPSessionStateService –DefaultProvision.

2) 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.

..<..modules runAllManagedModulesForAllRequests="true"..>.. …
.<.remove name="Session" ./>. .<.add name="Session" type="System.Web.SessionState.SessionStateModule" preCondition="" ./>. … modules>

ALSO,Additional steps to ensure the "web.config"
1.Add to the configuration/system.webServer/modules element.
2.Set the enableSessionState attribute of the configuration/system.web/pages element to true.
3.Add to the configuration/system.web element


3) Reset IIS.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.