我有以下代码:
app.UseCookieAuthentication(new CookieAuthenticationOptions
{
AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
ExpireTimeSpan = TimeSpan.FromSeconds(5),
CookieSecure = CookieSecureOption.Never,
CookieHttpOnly = false,
SlidingExpiration = true,
LoginPath = new PathString("/Account/Login")
});
我尝试做的是在Cookie过期时执行操作(将一些信息记录到db),从而退出用户。我试图通过LogoutPath实现这一点,但我意识到它没有做我期待的......
有没有办法在cookie过期时注入一个动作?