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:

  1. Open Windows Explorer.


  2. Change folders to your %SystemRoot%\help\iishelp\common folder.


  3. Open 500-100.asp in a text editor, such as Microsoft Notepad. The top lines of the file should resemble the following:


  4. 
      <%@ language="VBScript" %>
       <%
         Option Explicit
    
         Const lngMaxFormBytes = 200
        %> 
  5. Change these lines to:
    
    <%@ language="VBScript" %>
       <%
         Option Explicit
         On Error Resume Next
    
         Const lngMaxFormBytes = 200
        %> 



MORE INFORMATION

Steps to Reproduce this Behavior

  1. Disable session state for the default Web site:

    1. Select the default Web site in the Microsoft Management Console (MMC).


    2. Right-click and select Properties from the pop-up menu.


    3. Click the Home Directory tab.


    4. Click Configuration, or click Create and then click Configuration.


    5. Click the App Options tab.


    6. Clear the Enable Session State checkbox.


    7. Click OK as necessary to return to the MMC.




  2. Create a page in your Wwwroot folder named Divbyzero.asp with the following contents:


  3. 
    <%@Language="VBSCRIPT"%>
    <% Response.Write 1/0 %> 
  4. 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


Last Reviewed: February 2, 2000
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.