- Configure SQL Server to store ASP.NET session state
- Recycling Settings for an Application Pool
- FormsAuthentication.Timeout
- Automatic fix for tempdb error related to 'ASPStateTempSessions'
- First uninstall the ASPState database by using the command:
aspnet_regsql –ssremove –E -S .
Note: -E is to indicate you want to use integrated security connection. -S informs what SQL server and SQL instance to use, and the "." (dot) specifies default local instance
- Then re-install using the command:
aspnet_regsql –ssadd –sstype p –E -S .
Note: The sstype has three options, t | p | c ... the first "t", tells the installer to host all stored procedures in the ASPState database, and all data in the tempdb. The second option "p" tells the installer to persist data to the ASPState database. The last option "c" allows you to specify a different 'custom' database to persist the session state data. If you reinstall using the "-sstype p" you then need only to supply datareader/datawriter to the ASPState database for the user that's making the connection (in most cases, the application pool's identity in IIS). The added benefit of persisting the data is that session state is retained even after a restart of the service. The only drawback is that you need to ensure the agent cleanup job is pruning old sessions regularly (it does this by default, every minute). Important: If you are running a cluster, you must persist session data. You're only option is to use sstype 'p' or 'c'.
Last active
January 16, 2024 03:57
-
-
Save hoangitk/2019e132ab56da124daaa72df1f3bc15 to your computer and use it in GitHub Desktop.
[ASP.NET Session, Cookie] #aspnet #hosting
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment