1

How hard is it to setup a session state database for ASP.NET application running in an IIS farm?

I've received advice to never store anything at all in session state in my new ASP.NET 4 / IIS 7 application. This is following a discussion where I pointed out that this application will have low volume and store very little in session. The main justification I was given for this advice is that it would be extremely difficult to setup IIS and a database to store session state in our web farm.

Chuck
  • 53
  • 6

1 Answers1

2

Trivial if you have sufficient permission. All you need to do is run aspnet_regsql.exe with the proper options and connection string. You need to be able to create tables, stored procedures, user-defined data types, and a SQL job. Your DBA should have sufficient privileges to run this job if you don't. Make sure you use the .NET 4 version of the executable as previous versions differ.

You can find aspnet_regsql.exe in c:\windows\Microsoft .NET\Framework\<version>

tvanfosson
  • 524,688
  • 99
  • 697
  • 795
  • The microsoft instructions are easy to follow. [link]http://msdn.microsoft.com/en-us/library/ms229862(v=VS.100).aspx. But they don't mention "farms". I know nothing about setup of IIS farms. Is there any additional knowledge required for that situation? – Chuck Dec 05 '11 at 01:47
  • http://support.microsoft.com/kb/325056 - you need to make sure the application path is the same so that it retrieves the correct session from the server for the request and that your machine keys are shared across the web farm (so that the session cookie can be decrypted). – tvanfosson Dec 05 '11 at 01:55