1、using System.Web.SessionState;
2、实现接口IRequiresSessionState
public class Handler : IHttpHandler,IRequiresSessionState{
string code = context.Session["code"].ToString();
}