我有以下代码:
public void ConfigureAuth(IAppBuilder app) { app.UseCookieAuthentication(new CookieAuthenticationOptions { AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,ExpireTimeSpan = System.TimeSpan.FromMinutes(1),LoginPath = new PathString("/Account/Login"),logoutPath = new PathString("/Account/logoff") });
解决方法
它到期了.
确保您没有任何背景ajax活动,因为它扩展了会话(默认情况下,SlidingExpiration为true).
此外,我将ExpireTimeSpan从the default 14 days更改为较小的值后,我必须手动删除旧的Cookie.