From: simonxy on
I created a hhtpModul.
If I call aspx page, it works. If I call asp page it doesn't work.
I'm using OnAcquireRequestState event and I would like to check if
there is active session.
But I get an error that ctx.Session is null.

Is there any other option to check if session is active? Maybe read
sessionID from cookie and check if this ID is active on IIS server?
How can I do that?

Thank you for your answer.

private void OnAcquireRequestState(object sender, EventArgs e)
{
HttpApplication app = (HttpApplication)sender;
HttpContext ctx = app.Context;
String hash="";

if (ctx.Session != null)
{
if (ctx.Session.Contents["hash"] != null)
hash = ctx.Session.Contents["hash"].ToString();
}
.....
.....
ctx.Session["hash"] = "hash";
}

regards,Simon