views:

130

answers:

1

I have a site where when accessing via site.com/default.aspx everything is fine, however when accessing via site.com/ I get a session error as follows:

"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."

I have confirmed that default.aspx is the highest priority default document and that it is the page being loaded. However why is this session error only occurring when accessing via the default document?

The server is 2008 R2 and IIS 7.5.

A: 

Answering my own question here. Another symptom was that Page.User was always null. I found a post on SO about something similar

http://stackoverflow.com/questions/2025398/urlrewriting-net-module-iis7-equals-page-user-null

and while we are not using the urlrewriting module, adding the

runAllManagedModulesForAllRequests="true"

to the modules section in the web.config. Hope this can help someone else some day!

schmidty