It seems I don\'t understand clearly how IsPersistent
in OWIN cookie authentication works, the code below is to use IsPersistent
:
v
Persistent cookies for .Net Core 2.2 you might want to try this
Example
var claimsIdentity = new ClaimsIdentity(new[]
{ new Claim(ClaimTypes.Name, "test"),},CookieAuthenticationDefaults.AuthenticationScheme);
HttpContext.SignInAsync(CookieAuthenticationDefaults.AuthenticationScheme, new ClaimsPrincipal(claimsIdentity), new AuthenticationProperties
{
IsPersistent = true,
ExpiresUtc = DateTime.UtcNow.AddMinutes(30)
});