It looks like it is a known issue and whether or not session state is available is actually decided... by the SessionStateModule itself!
Briefly, in order to force session state to load current Context.Handler, usually DefaultHttpHandler, has to be replaced in the PostMapRequestHandler event by some other handler, implementing IRequiresSessionState. To be safe, my dummy handler carries a
reference to the original handler, and I swap it back in the PostAcquireRequestState event, once the dummy handler fulfilled its purpose.
tdjastrzebsk...
Member
320 Points
108 Posts
Re: SessionState in HttpModule problem (2.0)
Apr 14, 2007 02:16 PM|LINK
I just came across this great post by Mike Volodarsky, IIS Core Server / ASP.NET Runtime Program Manager
https://forums.iis.net/thread/1648944.aspx
It looks like it is a known issue and whether or not session state is available is actually decided... by the SessionStateModule itself!
Briefly, in order to force session state to load current Context.Handler, usually DefaultHttpHandler, has to be replaced in the PostMapRequestHandler event by some other handler, implementing IRequiresSessionState. To be safe, my dummy handler carries a reference to the original handler, and I swap it back in the PostAcquireRequestState event, once the dummy handler fulfilled its purpose.
Tomasz J