Web Api2中使用Session

要在webApi里面使用Session必须在Global.asax插入

       public override void Init()
        {
            this.PostAuthenticateRequest += (sender, e) => HttpContext.Current.SetSessionStateBehavior(SessionStateBehavior.Required);
            base.Init();
        }
原文地址:https://www.cnblogs.com/Linyb/p/4528140.html