500-100.asp Returns "Variable is Undefined" Error When Session State is Disabled
ID: Q244773
|
The information in this article applies to:
-
Microsoft Internet Information Services version 5.0
SYMPTOMS
When an Active Server Pages (ASP) error is generated in a Web site where session state is disabled, ASP returns an error message like the following:
Microsoft VBScript runtime error '800a01f4'
Variable is undefined: 'Session'
/iisHelp/common/500-100.asp, line 119
CAUSE
This behavior is by design. The session object is not registered in the scripting name space, so the executing script in the 500-100.asp page does not understand it, and so ASP returns an error message.
WORKAROUND
The default 500-100.asp error page can be modified to ignore errors by adding an "On Error" statement:
- Open Windows Explorer.
- Change folders to your %SystemRoot%\help\iishelp\common folder.
- Open 500-100.asp in a text editor, such as Microsoft Notepad. The top lines of the file should resemble the following:
<%@ language="VBScript" %>
<%
Option Explicit
Const lngMaxFormBytes = 200
%>
- Change these lines to:
<%@ language="VBScript" %>
<%
Option Explicit
On Error Resume Next
Const lngMaxFormBytes = 200
%>
MORE INFORMATION
Steps to Reproduce this Behavior
- Disable session state for the default Web site:
- Select the default Web site in the Microsoft Management Console (MMC).
- Right-click and select Properties from the pop-up menu.
- Click the Home Directory tab.
- Click Configuration, or click Create and then click Configuration.
- Click the App Options tab.
- Clear the Enable Session State checkbox.
- Click OK as necessary to return to the MMC.
- Create a page in your Wwwroot folder named Divbyzero.asp with the following contents:
<%@Language="VBSCRIPT"%>
<% Response.Write 1/0 %>
- When you browse to the page, you will see the error message.
REFERENCES
Additional query words:
iis
Keywords :
Version : winnt:5.0
Platform : winnt
Issue type : kbprb