Sep 25, 2014 at 4:08 PM
Edited Sep 25, 2014 at 4:22 PM
I'm developing a custom authentication OMC and trying to maintain state per http request but it's not working. It's clear that MS OWIN is calling the
method on my middleware class exactly 5 times per http request which means my handler class is also created 5 times and therefore no state is shared between instances.
I've tried shoving things into the context like
to maintian state between instances but it doesn't work either since each of my handler instances receives a fresh context. I've also tried to play with the
for my middleware, but regardless of the value my handler is instantiated exactly 5 times.
- What's going on under the covers that is causing MS OWIN to instantiate my handler this many times per http request?
- Why wouldn't it just call it exactly once?
- How can I maintain state per http request in OWIN?