Session does not always exist in the context of the current Application_Error . Try the following:
protected void Application_Error(object sender, EventArgs e) { if (Context.Handler is IRequiresSessionState || Context.Handler is IReadOnlySessionState) {
GenericTypeTea
source share