Using Session variables in Session_End
I encountered a problem where i needed to delete a folder from my application root folder at Session_End event. The folder name was assigned by the session id. I tried to access the session using HttpContext.Current object but in this time, the object is null because there is no web request however i looked at the HttpApplication class in which the Global class is derived, i found out a property called Session. Using the Session property, you can access all the session properties, methods.
protected void Session_End(Object sender, EventArgs e)
{
string sessionID = Session.SessionID;
Session.Abandon();
}
Best Regards,
HC