ASPStateTempSessions and the ASPStateTempApplications tables

You can configure Microsoft SQL Server for ASP.NET SQL Server mode session state management.

Why there are no tables in the ASPState database after the configuration?
When you use the default InstallSqlState.sql script file to configure ASP.NET SQL Server mode session state management, the script file adds the ASPStateTempSessions and the ASPStateTempApplications tables to the tempdb database in SQL Server by default. If you restart SQL Server, you will lose the session state data that was stored in the ASPStateTempSessions and the ASPStateTempApplications tables.

How the deletion of expired sessions work?
The InstallSqlState.sql script creates a job called ASPState_Job_DeleteExpiredSessions to delete expired sessions from tempdb. Recall that ASP.NET does not keep session resources alive indefinitely. To support this feature when a SQL Server is used to maintain state, the SQL Server Agent must be running so that the expired session deletion job runs as needed. By default, the job is scheduled to run every minute. It deletes session state rows with an Expires value less than the current time. The account under which the SQL Server Agent runs must have the privilege to execute the DeleteExpiredSessions stored procedure.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: