MVC 5 中启用Session
打开global.asax.cs 文件,增加如下代码
protected void Application_PostAuthorizeRequest()
{
HttpContext.Current.SetSessionStateBehavior(System.Web.SessionState.SessionStateBehavior.Required);
}
打开global.asax.cs 文件,增加如下代码
protected void Application_PostAuthorizeRequest()
{
HttpContext.Current.SetSessionStateBehavior(System.Web.SessionState.SessionStateBehavior.Required);
}