in

SharePoint Blogs

The Best Place for SharePoint-related Blogs

Eric Kraus SharePoint Blog

Enable Session State in SharePoint 2007

Here’s a quick and dirty on how to enable Session State within your MOSS 2007 farm.

I’ve been stuck on this many times before, so for my sake and hopefully a few others’, I decided to write a quick note on the process.

First, the biggest difference to realize is that our session state will be stored in our SQL Server database.  This is required over the traditional memory-based session because of multiple application servers in a web farm architecture.

Secondly, in order for our web applications to store session variables in SQL, we need to “prep” the database for session state data. 

1.  Create a Shared Services Provider.  This is required in order to enable Session State and its content database is the location of our session data.  If you already have an SSP, you can use the existing one.

2.  If needed, associate your web application with this SSP (done by default if it is your first SSP).

3.  In Central Administration, under Application Management, choose Session State, and ensure that it is enabled.

4.  From a command prompt, navigate to the Microsoft.NET 2.0 Framework directory
(typically:  C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727)

5.  Modify your web.config:

Uncomment the following line: 
<add name=”Session” type=”System.Web.SessionState.SessionStateModule” />

Modify the following line:
<pages enableSessionState=”true” ….. />

6.  Run the following command:

aspnet_regsql.exe –S  <server_name>  -d  <database_name>  -ssadd  -sstype c  -E

where:
<server_name>  is the database server where your database is located
<database_name>  is the content database of your shared services provider

Run aspnet_regsql.exe /?  for more information on the remaining options


Comments

 

SHAREPOINTBlogs.com Mirror said:

Here’s a quick and dirty on how to enable Session State within your MOSS 2007 farm. I’ve been stuck on

December 9, 2007 4:45 PM
 

Links (12/9/2007) « Steve Pietrek’s SharePoint Stuff said:

Pingback from  Links (12/9/2007) &laquo; Steve Pietrek&#8217;s SharePoint Stuff

December 9, 2007 4:53 PM

Leave a Comment

(required )  
(optional )
(required )  
Add

About erickraus

Eric has recently moved positions to become a SharePoint consultant with Microsoft Corporation in Minneapolis, MN. He has been working with .NET for 6 years and MOSS since Beta releases. Eric is MCTS certified in MOSS 2007 and holds an MCAD certification in .NET. He has implemented several enterprise collaboration and web content management solutions as well as numerous custom applications integrating MOSS, .NET, BizTalk, and Oracle. When not dreaming of SharePoint, Eric enjoys photography, snowboarding, and spending time with his girlfriend.


Need SharePoint Training? Attend a SharePoint Bootcamp!

Posts (c) their respective authors. Everything else (c) 2007 SharePoint Experts