3

I'm doing an advanced project with ASP .NET Sessions, I would like to know:

A) What do I add exactly to my web.config to enable full session writing to the database server.

B) What table would the sessions be stored in once enabled? So far I'm only aware that the default is "TempDB".

John Saunders
  • 160,644
  • 26
  • 247
  • 397
TheFrack
  • 2,823
  • 7
  • 28
  • 47
  • 1
    http://support.microsoft.com/kb/317604 – Andre Calil Aug 22 '12 at 12:55
  • 1
    Step-by-step (including the answer for **B** ): http://www.developer.com/net/asp/article.php/3595766/Storing-Session-State-in-a-SQL-Server-Database.htm – Andre Calil Aug 22 '12 at 12:57
  • 1
    @JohnSaunders Leave my post alone, that's ridiculous. Thanks Andre, that support article is the best thing I've seen and I can't believe I didn't find that on google. I would award you the answer if you posted it. Thanks so much. At least Antonio didn't remove my "Thanks!"... – TheFrack Aug 22 '12 at 13:11

2 Answers2

3

You can find all configuration details on this MSDN article. Go to section SQL Server Mode

This is the required configuration

<configuration>
  <system.web>
    <sessionState mode="StateServer"
      stateConnectionString="tcpip=SampleStateServer:42424"
      cookieless="false"
      timeout="20"/>
  </system.web>
</configuration>

Here you have some details about where the session information is stored and how to change the default location. For more details, check this article as Andre Calil suggested.

By default, the Aspnet_regsql.exe tool will create a database named ASPState containing stored procedures that support SQLServer mode. Session data itself is stored in the tempdb database by default. You can optionally use the -sstype option to change the storage location of session data

Claudio Redi
  • 67,454
  • 15
  • 130
  • 155
2

Follow the steps mentioned at below link: http://support.microsoft.com/kb/308100

Rushabh
  • 385
  • 2
  • 5
  • 14