Quantcast
Channel: All Forums
Viewing all articles
Browse latest Browse all 27852

Obtaining Session State in a IHttpModule or IHttpHandler when a request is for a static file

$
0
0

Hi.

We are developing a IHttpModule that requires session state to be available when the pipeline reaches the Process Request stage.

We use the following :-

application.PostMapRequestHandler += newEventHandler(SetSessionStateBehavior);

and in this method we apply the following:-

application.Context.SetSessionStateBehavior(SessionStateBehavior.Required);

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 interfaceIRequiresSessionState, as follows:-

application.Context.RemapHandler(newPlaceHolderHandler());

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.

Regards

Adrian.


Viewing all articles
Browse latest Browse all 27852

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>