My ASP.NET web application works fine in Internet Explorer, but in Firefox and Chrome I have a problem where HttpContext.Current
is defined, but HttpContext.Current.Session
is null. The error is probably caused by the fact that the Session object is being accessed to early in the ASP.NET page life cycle. But since the web site is primarely going to be accessed using Internet Explorer I'm hoping to find a quick, acceptable fix. Perhaps something along these lines:
if (HttpContext.Current.Session == null)
{
// Create Session - but how?
}
So the question is: Can I create the Session object programmatically in ASP.NET?
Edit: The bug was apparantly related to a .designer file that was out of sync. Weird, but now it works.