In my ASP.NET Core MVC app the lifetime of the authentication cookie is set to \'Session\', so it lasts until I close the browser. I use the default authentication scheme fo
For some reason I had the issue when using SignInAsync([..], true) the cookie was never be shown in browser (and properly the login failed):
So, I tried adding the UTC timezone difference into the TimeSpan of ExpireTimeSpan
services.AddIdentity(o =>
{
// add TimeSpan with 5 minutes plus timezone difference from Utc time
o.Cookies.ApplicationCookie.ExpireTimeSpan = DateTime.Now.Subtract(DateTime.UtcNow).Add( TimeSpan.FromMinutes(5) );
});
Voila! It worked and the cookie is shown with +5min expiration only in browser.
PingBack to github.com https://github.com/aspnet/Identity/issues/766#issuecomment-253237576