Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the hueman domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/CloudIngenium.com/htdocs/wp-includes/functions.php on line 6114
How to enable Session in a SharePoint 2010 Application page? – Knowledge eXchange

How to enable Session in a SharePoint 2010 Application page?

How to enable Session State in SharePoint 2010

So as a developer you may have come across the need to use the Session object along the way. What you’ve probably noticed is that you get an error message that indicates you should enable session state as well as configure your http session module for sessions:

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 web.config

In order to resolve this you should make two entries into your web.config (in this case the one located under: C:Program FilesCommon FilesMicrosoft SharedWeb Server Extensions14TEMPLATELAYOUTS) file and run an SP command:

The first is to ensure that enableSessionState is set to TRUE.

<pages enableSessionState=”true” enableViewState=”true” enableViewStateMac=”true” […]>

if you don’t have the pages directive you can add it the following one under the <configuration> -> <system.web> nodes:

<pages enableSessionState=”true” enableViewState=”true” enableViewStateMac=”true” >

</pages>

This is found under the <configuration> -> <system.web> nodes

The second is to ensure that you have enabled Session as an http module by addint the following lines under the <configuration> -> <system.web> nodes:

<httpModules>      <add name = “Session ” type = “System.Web.SessionState.SessionStateModule ” />    </httpModules>

The third step is to run the following SP command line:

Enable-SPSessionStateService –DefaultProvision

This instruction needs to be executed in the SP 2010 Power shell otherwise it won’t work. Be sure to run the power-shell as an administrator otherwise it won’t work.

For more information please visit the references below

References:

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.