Enabling Session State Persistence

Applies To: Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1

You can enable session state persistence for ASP applications. If you enable session state persistence, the server will create a new Session object for each connection and session state will be accessible, session storage will be allowed, Session_OnStart and Session_OnEnd will occur, and ASPSessionID cookie will be sent to the client. If you do not enable session state persistence, state access and storage are not allowed, events are not processed, and no cookie is sent. By default, session state persistence is enabled with the session timeout at 20 minutes. The corresponding metabase property is AspAllowSessionState Metabase Property.

Important

You must be a member of the Administrators group on the local computer to perform the following procedure or procedures. As a security best practice, log on to your computer by using an account that is not in the Administrators group, and then use the runas command to run IIS Manager as an administrator. At a command prompt, type runas /user:Administrative_AccountName "mmc %systemroot%\system32\inetsrv\iis.msc".

To enable session state persistence for an ASP application

  1. In IIS Manager, double-click the local computer, right-click the Web Sites folder or an individual Web site folder, and then click Properties.

    Note

    Configuration settings made at the Web Sites level are inherited by all of the Web sites on the server. You can override inheritance by configuring the individual site or site element.

  2. Click the appropriate tab: Home Directory, Virtual Directory, or Directory.

  3. In the Application settings area, click Configuration, and then click the Options tab.

  4. On the Options tab, in the Application configuration section, select the Enable session state check box.

  5. In the Session timeout box, click the up or down arrow to set the number of minutes until the session expires.

  6. Click OK.