Reputation: 8599
I need to know how to configure the .config to manage Session state in SQL Server
Upvotes: 1
Views: 3697
Reputation: 8599
First you need to create a Session database. In order to do this:
Where ServerName is your server name.
This will create this database ASPState
Now the configuration on the web.config
Add this sentence over
<sessionState allowCustomSqlDatabase="false" mode="SQLServer" sqlCommandTimeout="7200" sqlConnectionString="Server=SERVERNAME;User ID=User;Password=Password;" timeout="120" />
sqlCommandTimeout="7200" = 2hours and timeout="120" = 2hours
If you need more options regarding aspnet_regsql you can take a look HERE
Upvotes: 6
Reputation: 11313
<configuration>
<sessionstate
mode="stateserver"
cookieless="false"
timeout="20"
sqlconnectionstring="data source=127.0.0.1;user id=<user id>;password=<password>"
server="127.0.0.1"
port="42424"
/>
</configuration>
Additional options here: http://msdn.microsoft.com/en-us/library/ms972429.aspx
Upvotes: 2