Article ID: 242425
Article Last Modified on 11/21/2006
APPLIES TO
- Microsoft Internet Information Services 5.0
- Microsoft Internet Information Server 4.0
This article was previously published under Q242425
We strongly recommend that all users upgrade to Microsoft Internet Information Services (IIS) version 6.0 running on Microsoft Windows Server 2003. IIS 6.0 significantly increases Web infrastructure security. For more information about IIS security-related topics, visit the following Microsoft Web site:
SYMPTOMS
When trying to use a session-level object or variable when session state is disabled, you may receive the following error message:
CAUSE
This behavior is by design. The session object is not registered in the scripting name space, so any executing scripts do not understand it and return a "Type mismatch" error message.
MORE INFORMATION
The following steps will reproduce this behavior.
- Disable session state at the folder or site level:
- Select a Web site or folder in the Microsoft Management Console (MMC).
- Right-click the item and select Properties.
- Select the Directory or Home Directory tab.
- Click Configuration or Create, and then click Configuration.
- Select the App Options tab
- Clear the Enable Session State box.
- Click OK to return all the way back to the MMC.
Create a page in the application's physical folder named Sesstest.asp with the following contents:
<% Session("strTest") = "Some Text" %>
- Browse the page. You should see the error.
- Disable session state at the page level:
- Highlight a Web site or folder in the MMC.
- Right-click the item and select Properties.
- Select the Directory or Home Directory tab.
- Click Configuration or Create and then click Configuration.
- Select the App Options tab.
- Select the Enable Session State check box.
- Click OK to return all the way back to the MMC.
Create a page in the application's physical folder named Sesstest.asp with the following contents:
<% @EnableSessionState = False %> <% Session("strTest") = "Some Text" %>
- Browse to the page. You should see the error.
Additional query words: iis asp
Keywords: kbprb kbpending KB242425