Tuesday, April 05, 2005

ASP.NET SQL Server Session state - Links and Overview

Basic steps to set up SQL Server Session state
1. Run either of these scripts (InstallSqlState uses temp tables, InstallPersistSqlState uses permanent tables so it survives reboots)
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\InstallSqlState.sql
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\InstallPersistSqlState.sql

2. Change your session state mode in web.config to SQLServer:
mode="SQLServer"
sqlConnectionString="data source=server;user id=uid;password=pwd"
cookieless="false" timeout="20" />

References
Good overview http://idunno.org/dotNet/sessionState.aspx

MSDN overview of SQL Server Session State
http://support.microsoft.com/default.aspx?kbid=311209

Common issues
325056 PRB: Session State Is Lost in Web Farm If You Use SqlServer or
http://support.microsoft.com/?id=325056
323744 FIX: "The View State Is Invalid for This Page and Might Be Corrupted"
http://support.microsoft.com/?id=323744


With Best Regards,
Mitesh V. Mehta

No comments: