Session state can only be used when enableSessionState is set to true

Oct 1, 2010 at 3:36 AM

I am trying to install the webpart into WSS 3.0 and getting a blank webpart and upon editing it I get this error

Initially the .bat install file failed saying the application at http://localhost did not exist so I used solution management in the Sharepoint Administration Site to deploy the webpart which worked ok.

I then manually activated the webpart ID with stsadm.

I then enabled the webpart in the gallery.

I then added the webpart to a page and got the following:

Here is the full error:

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, 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 <configuration>\<system.web>\<httpModules> section in the application configuration.]
   System.Web.UI.Page.get_Session() +4068962
   LiveSSO.CustomToolPart.OnInit(EventArgs e) +653
   System.Web.UI.Control.InitRecursive(Control namingContainer) +143
   System.Web.UI.Control.AddedControl(Control control, Int32 index) +271
   System.Web.UI.WebControls.WebParts.EditorZoneBase.CreateChildControls() +219
   Microsoft.SharePoint.WebPartPages.ToolPane.CreateChildControls() +833
   System.Web.UI.Control.EnsureChildControls() +146
   Microsoft.SharePoint.WebPartPages.ToolPane.OnSelectedWebPartChanged(Object sender, WebPartEventArgs e) +541
   System.Web.UI.WebControls.WebParts.WebPartEventHandler.Invoke(Object sender, WebPartEventArgs e) +0
   Microsoft.SharePoint.WebPartPages.SPWebPartManager.BeginWebPartEditing(WebPart webPart) +201
   Microsoft.SharePoint.WebPartPages.SPWebPartManager.ShowToolPaneIfNecessary() +516
   Microsoft.SharePoint.WebPartPages.SPWebPartManager.OnPageInitComplete(Object sender, EventArgs e) +703
   System.EventHandler.Invoke(Object sender, EventArgs e) +0
   System.Web.UI.Page.OnInitComplete(EventArgs e) +11034782
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1674

 


Version Information: Microsoft .NET Framework Version:2.0.50727.3615; ASP.NET Version:2.0.50727.3614

<!-- [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 <configuration>\<system.web>\<httpModules> section in the application configuration. at System.Web.UI.Page.get_Session() at LiveSSO.CustomToolPart.OnInit(EventArgs e) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.AddedControl(Control control, Int32 index) at System.Web.UI.WebControls.WebParts.EditorZoneBase.CreateChildControls() at Microsoft.SharePoint.WebPartPages.ToolPane.CreateChildControls() at System.Web.UI.Control.EnsureChildControls() at Microsoft.SharePoint.WebPartPages.ToolPane.OnSelectedWebPartChanged(Object sender, WebPartEventArgs e) at System.Web.UI.WebControls.WebParts.WebPartEventHandler.Invoke(Object sender, WebPartEventArgs e) at Microsoft.SharePoint.WebPartPages.SPWebPartManager.BeginWebPartEditing(WebPart webPart) at Microsoft.SharePoint.WebPartPages.SPWebPartManager.ShowToolPaneIfNecessary() at Microsoft.SharePoint.WebPartPages.SPWebPartManager.OnPageInitComplete(Object sender, EventArgs e) at System.EventHandler.Invoke(Object sender, EventArgs e) at System.Web.UI.Page.OnInitComplete(EventArgs e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) [HttpUnhandledException]: Exception of type 'System.Web.HttpUnhandledException' was thrown. at System.Web.UI.Page.HandleError(Exception e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) --><!-- This error page might contain sensitive information because ASP.NET is configured to show verbose error messages using <customErrors mode="Off"/>. Consider using <customErrors mode="On"/> or <customErrors mode="RemoteOnly"/> in production environments.-->
Oct 5, 2010 at 11:58 PM

Nevermind I solved it

Solution was to edit the web.config file in sharepoint site root.

enableSessionState =true (this was set to false)

and had to uncomment this line which was commented out.

"<add name="Session" type="System.Web.SessionState.SessionStateModule"/>"