0

We have a webapp configured as a webgarden. Because of this we want to user store session state using sqlserver mode. My configuration in the web.config is as follows

<sessionState mode="SQLServer" cookieless="false" sqlConnectionString="data source=[DBSERVER]; Database=ASPState; user id=[USERNAME];password=[PASSWORD];" />

I've ran the Aspnet_regsql.exe tool and set -sstype as "p"

I've confirmed that I can connect to the ASPState DB from the webserver also, the provided username has permission to execute all stored procedures on the DB.

Using the developer tools in Chrome, I can see the ASP.NET Session cookie and see the ID, so i know the session is being created.

I'm getting any sort of DB error.

However, when I query the "ASPStateTempSessions" table, there are no records. There aren't any records in the "ASPStateTempApplications" either.

When should these sessions be saved to the database? Why am I unable to see them?

Matt Stewart
  • 322
  • 3
  • 14

2 Answers2

0

Try adding the timeout attribute.

<sessionState mode="SQLServer" cookieless="false" sqlConnectionString="data source=[DBSERVER]; Database=ASPState; user id=[USERNAME];password=[PASSWORD];" timeout="20" />
Kevin C.
  • 155
  • 1
  • 8
0

Try to add timeout and application name, ASPState is default database, so we can remove it

    <sessionState mode="SQLServer" timeout="20" sqlConnectionString="Data Source=SQLServer; Application Name=App; user id=UserName; password=Password"/>
Tony Dong
  • 3,213
  • 1
  • 29
  • 32