0
votes

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?

2
Could you able to insert and retrieve data from SessionState besides no records in ASPStateTempSessions?Win
Do you mean manually insert/update records in that db?Matt Stewart

2 Answers

0
votes

Try adding the timeout attribute.

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

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"/>