Monday, May 03, 2010

How to enable Session State in SharePoint 2010

Hi Folks,

If you are trying to use any of SharePoint 2010 Features that use Session state service in SharePoint, Then you need to enable session state service in SharePoint 2010 since it is disabled by default, Here is how to do it:

1) Open SharePoint 2010 Management Shell (As Administrator) and type the following command:

enable-SPSessionStateService

The shell will prompt you to enter the required DB name to store the session state data, type the database name.

Once you get the prompt back to you, You can check the created DB name, under sharepoint instance: SERVERNAME\SHAREPOINT to make sure the DB has been created.


2) Open the site web.config file and enable the session state on the site:

enableSessionState="true"

3) Reset IIS.

Check the feature or navigate to the site template that depends on session state ( For Example: Project Database site template) and will see it is working.

Hope it helps.

Regards,
Mostafa Elzoghbi

2 comments:

Mahmoud Aleryan said...

Thanks for this tip, but many people don't recommend to enable it.
It affects the SharePoint farm performance.

Unknown said...

The session state in this post is talking about SharePoint 2010 is a database session state. It is like any database transaction you do against your db.

If you are talking about server session, still you can use it but wisely and know what to store and minimize the data required to be stored.

Session state also can be stored in in a DB server or a remote Application server.

Let me know if you have other questions.

Hope this explanation is helpful.