Read session from module

S

simonxy

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top