views:

77

answers:

1

I have seen in some other questions that using Session_ End() in Global.asax.cs is not advised. This is because if you're not using the default Session handler, Session_End won't get called, correct? Is there any other cases where it won't get called?

The big question is: If you can't depend on Session_End(), what do you do to determine when a session has closed?

A: 

Can you not just check if it exists before using it?

if (Session["Variable"] != null)
{
    // Code here
}
Chalkey
I want to know when a session has expired, not if I can access a session variable.
grimus