I need some HttpApplication local storage. I thought the ApplicationState was the place for this, but apparently this may be shared across HttpApplication instances in an Appdomain.
public class MyHttpModule : IHttpModule
{
private object initializingLock = new object();
private static HttpApplication last;
public void Init(HttpApplication context)
{
lock (initializingLock)
{
// always is false, as expected
if (last == context)
{
}
// is true for 2nd HttpApplication in AppDomain!
if (last != null && last.Application == context.Application)
{
}
last = context;
}
}
}
What's the best blace to use to store some data that's per HttpApplication that other stuff can access?