Why is HttpContext.Current null during the Session_End event? On Session_End there is no communication necessarily involved with the browser so there is no HttpContext to refer to which explains why it is null. Looking at your code you seem to be int…
public static HttpContext Current { get { if (instance.Value == null) { instance = new ThreadLocal<HttpContext>(() => new HttpContext()); } return (HttpContext)instance.Value; } } protected static ThreadLocal<HttpContext> instance;…