Does anyone know a clean way of adding events to Session's OnStart and OnEnd events using an HttpModule (without touching the Global.asax file)?
+1
A:
public void Init(HttpApplication app)
{
var ssm = app.Modules["Session"] as SessionStateModule;
ssm.Start += Foo;
ssm.End += Bar;
}
leppie
2009-02-11 22:57:33
Google brings up this solution in the comments of this blog: http://codebetter.com/blogs/karlseguin/archive/2006/06/12/146356.aspx but the author describes it as "something of a nightmare". Why would that be? Just a little concerned that this could cause issues.
cbp
2009-02-12 00:26:49
Just found this answer and also wonder whether this is the right things to do, after somebosy has indicated it's "something of a nightmare"?
Mark Redman
2009-08-16 18:37:35