HttpException (0×80004005): Session state can only be used when enableSessionstate is set to true….
Posted on 21. Nov, 2009 by admin in IIS, Sharepoint
If you get this error:
Session state can only be used when enablesession is set to true, either in a configuration file or in the page directive.
Description: An unhanded exception occured during the execution of the current web request. Please review the stack for more information about the error and where it originated in the code.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[HttpException (0x80004005): Session state can only be used when enableSessionstate is set to true....]
Cause:
_Layouts virtual directory in IIS was not configured correctly
The following line is commented:
<httpModules>
<add name=”Session” type=”System.Web.SessionState.SessionStateModule” />
</httpModules>
to solve this issue do the following:
- open IIS
- expand the website
- right click on the _Layouts folder
- click on Add Virtual Directory
- go to web.config of the web application and uncomment the lines:
<httpModules>
<add name=”Session” type=”System.Web.SessionState.SessionStateModule” />
</httpModules>
hope this helps
