views:

594

answers:

3

Hi how do I set up an http handler so I can manipulate IRequiresSessionState? I need to change when I can access session state. There is a stackoverflow question that takes me 90% of the way there, I am just too green in c# to know how to actually implement it and get it to work. If one of you experts could give me a quick 123 I would be eternally grateful.

A: 

The code in this answer seems to be a pretty complete implementation of a HttpModule that's guaranteed to have access to session state. Could you be more specific about what's not working or what else you need it do to?

stevemegson
I am trying to access a session preinit. Could you step me through the process on how to use this code. e.g. 1. create a new class. 2. paste the code in. 3. at the top of the class the needs to access the session type "bla bla bla" to use the class you just created.
Praesagus
A: 

IRequiresSessionState is a marker interface. It doesn't have any members. There's nothing to implement. If you mark a class with it, the class has access to the Session. It's that simple.

Axl
I'm sorry I am pretty new to c#. I don't know what it means to 'mark' a class with it - put it in the class? Then what, I will have access to the session without referring to the code I just put in?
Praesagus
A: 

Here is a step by step explanation on how to use this functionality.

Praesagus