IIS 7 and Above
Obtaining Session State in a IHttpModule or IHttpHandler when a reque...
Last post Apr 12, 2013 10:37 AM by Perkinsville
Mar 09, 2013 06:05 AM|AdrianGould|LINK
We are developing a IHttpModule that requires session state to be available when the pipeline reaches the Process Request stage.
We use the following :-
and in this method we apply the following:-
Which works as expected.
However, if the request is for a static file, i.e website/image.gif then we assume the static file handler takes over our process request is never reached, so we have replaced the handler for our own dummy handler that implements the interface
IRequiresSessionState, as follows:-
this works but session state is not available for requests that reference a static files.
Can anyone help resolve this issue. We need a way of forcing session state to be available, regardless of the request URL.
Apr 12, 2013 10:37 AM|Perkinsville|LINK
The ASP.NET Handler is not used when requests to static files are made, so that code is likely not executed.
You might consider adding a global handler (Path = *) that is configured same as an ASPX file (Path = *.aspx).
Might work, HTH, Benjamin