Session Timeout


In addition to the Script Timeout, IIS also maintains a session timeout. If the user has not requested a new page within a given number of minutes, ASP will cancel the session and release any resources associated with the session. If a user is in the process of uploading a file, it is possible that the transfer will be aborted.

It is recommended you set the Session timeout to be larger than or equal to the Script Timeout. The Script Timeout is measured in seconds. The Session Timeout is measured in minutes.

Note: You need be concerned with the Session Timeout only if you have Session state enabled on your server or on your specific web application.

To set the Session Timeout:

You can set the Session Timeout in the following two ways:

  1. On a per-session basis, you can set the Session Timeout by ASP Scripting Code.
  2. For all scripts, you can set the default system-wide.

By ASP Script:

Use the Session.Timeout property within your ASP script. For example:

<% Session.Timeout = 60 %>

System Default in IIS3:

Edit the Registry using REGEDT32. Modify the following value:

HKEY_LOCAL_MACHINE\

SYSTEM\

CurrentControlSet\

Services\

W3SVC\

ASP\

Parameters\

SessionTimeout

Double-click this value, and set the Radix to decimal. You can now enter an appropriate value in minutes. For example, 60 minutes is equivalent to one hour.

System Default in IIS 4 or later:

Using the Microsoft Management Console, select your web application that will perform uploads. Right-click to select the properties. From the Properties dialog, click on the "Configuration" button. Choose the "App Options" tab. Assuming that Session State is enabled, set the "Session Timeout" to the desired number of minutes. For example, 60 minutes is equivalent to one hour.

Copyright © 2010 SoftArtisans, Inc. All rights reserved.