Friday, 4 June 2010

SharePoint Session State

Problem: Building a composite application in SharePoint 2010 I need to store information for a user. A basket/shopping cart like feature is required.
Initial Hypothesis: Store data against the user profile, or a custom list and retrieve using Linq/CAML or use session state. Session state is not supported by SP2010 OOTB and it can have severe performance implications.
Resolution: enable ASP.NET session state. This stores the session state in a SQL Server database. Start the Powershell cmd prompt:

Enter the following PowerShell command in the SharePoint 2010 Management Shell window:
or
Enable-SPSessionStateService -DatabaseName "ASPNet_State" -DatabaseServer "spdemo.dev" -SessionTimeout 30Each web application for which you want Edit the web.config file and set the enableSessionState property of the pages element as follows:

More Info:
http://social.msdn.microsoft.com/Forums/en/sharepoint2010general/thread/3145fd29-2315-42f7-8f9d-cf6d52dc3c95
http://www.kajanmoorthy.com/2010/05/enable-session-state-in-sharepoint-2010.html
http://todd-carter.com/post/2010/04/30/A-Session-State-By-Any-Other-Name.aspx

0 comments:

Post a comment