|
ASP .NET How to store Session value in a Database as session data is lost in webfarms
Create a custom database
D:\WINDOWS\Microsoft.NET\Framework\v2.0.50727>aspnet_regsql.exe -ssadd -sstype c
-d leedhar_session -U sa -P sa123 -S MURUGAN\SQLEXPRESS
Start adding session state.
.........................
Finished.
To use this custom session state database in your web application, please specif
y it in the configuration file by using the 'allowCustomSqlDatabase' and 'sqlCon
nectionString' attributes in the \ section.
Add this to web.config
sessionState allowCustomSqlDatabase="true"
sqlConnectionString="data source=MURUGAN\SQLEXPRESS;initial catalog=leedhar_session;
user id=sa;password=sa123" timeout="30" mode="SQLServer" cookieless="AutoDetect"
|
|