Wednesday, December 14, 2011

Session State Activation Steps


Working with one of our developers, he has a webpart that requires session state. After looking for this command with PowerShell, I found others using “Enable-SPSessionStateService -Defaultprovision”. After running this, we still had issues with adding the webparts to an SharePoint.

The following was our error message. “System.Web.SessionStateModule” or custom session state missing a section in the web config.

clip_image002

Step 1:

  • Enable-SPSessionStateService –Defaultprovision
  • Note: Do this on each server in the farm.

Step 2:

  • Go to your Web Application in INETPUB (C:\inetpub\wwwroot\wss\VirtualDirectories\newsite.company.com80) Web.Config
    Find "enableSessionState" change from false 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">

  • Note: Do this for each Web Application that you want this functionality to be available.

Step 3:

  • Next is to ensure that the “remove” and “add” lines exist in the modules section for Session is present.
Search For: <modules runAllManagedModulesForAllRequests="true">
Verify the following exists: (Add if missing)

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

../modules> End of..

  • Note: Do this for each Web Application that you want this functionality to be available.

Why cant this just be as easy as just running a command.

0 comments: