I have already seen a similar question that was posted here . I have essentially the same question, but with a slight twist.
I am trying to access the session information from the Session_End method, but the HttpContext is null by the time I get there, so I find no real way to get to it; it's almost the same as it was already completely removed by the time Session_End started.
The solution in a related question says that I can use the this.Sessionsession information that I need to refer to the variable HttpApplication.Sessionfrom the HttpApplication class inherited by Global. But in my application, we redefined the Session variable in Global to look like this:
public new static HttpSessionState Session
{
get
{
return HttpContext.Current.ApplicationInstance.Session;
}
}
So, for me, referring to this. The session will try to get information from the HttpContext, which is null.
So, I have 2 questions. Firstly, is there an event that fires before Session_End, but before the session data is cleared? And secondly, if there is no answer to the first question, is there another way to access this data from Session_End?
Thank.
source
share