引用using System.Web.SessionState;继承public class CheckSession : IHttpHandler,IRequiresSessionState就可以使用session了