Selecting the Method for Maintaining and Storing ASP.NET Session State (IIS 6.0)

You can configure the method used by ASP.NET to maintain session state. ASP.NET supports the following methods for maintaining session state:

In process. The process for maintaining session state runs in the same worker process as the ASP.NET application and approximates how Active Server Pages (ASP) applications maintain session state. If the worker process for the ASP.NET application recycles, all session state information is lost.

Out of process. The process for maintaining session state runs in a different worker process, either on the same Web server or another server, than the worker process for the ASP.NET application. If the worker process for the ASP.NET application recycles, session state information is retained.

You can configure ASP.NET session state settings by modifying the mode attribute in the <sessionState> section of the Machine.config file for all applications or in the Web.config file for specific applications. The session state settings in the IIS 6.0 metabase only apply to ASP applications. ASP.NET and ASP applications cannot share session state.

Select one of the following methods for storing.ASP.NET session state:

In process, local to the Web server. ASP.NET session state is managed by and stored on the local Web server. This is the default mode for ASP.NET session state management and it approximates how ASP applications manage session state.

This method allows the session state to be stored across worker process threads in a Web garden. However, the in-process mode does not allow session state to be store across servers in a Web farm. For more information about Web gardens, see "Configuring Web Gardens" in Ensuring Application Availability.

To use this method to store ASP.NET session state, set the session state mode attribute to InProc.

Out of process, by using the ASP.NET state service. The ASP.NET state service (aspnet_state.exe) runs as a service on Windows Server 2003. You can run the ASP.NET state service local to a Web server to support Web gardens, or on a separate server to support Web farms.

To use this method to store ASP.NET session state, set the session state mode attribute to StateServer.

Out of process, by using a computer running SQL Server. ASP.NET session state can be managed by and stored in a database on a computer running Microsoft SQL Server. Like the ASP.NET state service, this out-of-process mode provides support for Web gardens or Web farms.

To use this method to store ASP.NET session state, set the session state mode attribute to SQLServer.

Comments