public class Handler1 : IHttpHandler, IRequiresSessionState需要继承 IRequiresSessionState接口,告诉程序要使用session!System.Web.HttpContext.Current.Session["userinfo"];