<p>I am using the System.Web.Routing assembly in a WebForms application. When running the application deployed on win2008/IIS7 I got the following message.</p>

<blockquote>
  <p>Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive. Please also make sure that System.Web.SessionStateModule or a custom session state module is included in the \\ section in the application configuration. </p>
</blockquote>

<p>This is only a problem when using a route I have configured. It is not a problem when directly navigating to an aspx page.</p>

<p>EnableSessionState has been turned on in both the web.config and the Page directive. I have added the Session entry to httpmodule of the web.config.</p>

<p>This is not an issue when developing using Visual Studio on my workstation. It is only a problem when trying to run the application under IIS7 on Win 2008.</p>

I'm having the same issue and I think I know what the problem is.
I'm trying to implement a FileNotFound page under the routing system (something I've yet to figure out is how to both give a FileNotFound page AND give a 404 response in the header)
What I've found, is that for some reason, the pages registered with BuildManager seem to be instanced without session context (the page was not actually requested, just instanced!).
At least that's what it seems to do.
I'm now less sure of my previous assertion. Apparently, requests for images also go through the routing system when they do not exist on physically. This causes an
```
IRouteHandler
```
to be called when the image path matches. I'm pretty sure the session object does not exist when an image is requested, so that may cause the problem when the page that was routed to tries to access it.