I have a web service built for SharePoint 2007 that I am trying to port to SharePoint 2010. This web service is dependent on session state to function properly, but so far, I have been enable to get session state to work at all in SharePoint 2010. This web service runs as its own web application under t
he /_vti_bin
virtual directory. I have tried all of the following with no luck:
System.Web.SessionState.SessionStateModule
http module to my application's web.config file.System.Web.SessionState.SessionStateModule
http module to my SharePoint root web.config file.<pages enableSessionState="true" />
to my application's web.config file.<pages enableSessionState="true" />
to my root web.config file.Additional Environment info:
Had anyone had any luck getting a web application or web service to use session state in SharePoint 2010 yet?
Thanks!
Steve
You've already answered this yourself somewhere else on the interweb. :)
<httpModules>
<add name="Session" type="System.Web.SessionState.SessionStateModule" />
</httpModules>
THEN, you must go into your web application and add the same session state module to the IIS7 managed pipeline.
Open IIS 7 manager, and find your web application.
Double click "Modules" in the IIS section.
Click "Add Managed Module..." on the right hand pane.
In the Add Managed Module dialog, enter "SessionState"
or something like that for the name, and choose the following item from the dropdown:
System.Web.SessionState.SessionStateModule, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
After that, session state should be enabled for your web app/web service!
You may need to turn on the Session State Service. Use the PowerShell cmdlet Enable-SPSessionStateService. This will create a Session State database and start the service in SharePoint 2010.
Reference information: http://technet.microsoft.com/en-us/library/ee890113.aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With