8 04 2011
Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive
When IIS is not configured properly after creating SharePoint application and there are web parts or features that use session you may get the following error: Unexpected error occured: System.Web.HttpException: 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 \\ section in the application configuration.
As a solution you must register session state handler module in IIS.
- Open Internet Information Services manager.
- Move to site where problem occurred.
- Open modules list of this site.
- Add session state handler like show on the following image (click on it):
- Click OK, recycle application pool and refresh the page.
I am not very sure why SharePoint doesn’t enable this module by default as mostly default session state module is enough.