报错信息:会话状态在此上下文中不可用protected void Application_Error(object sender, EventArgs e){//以此判断是否可用Sessionbool HadInitSession = (sender as HttpApplication).Context.Session == null ? false : true;//.......}