HttpContext.SignInAsync( CookieAuthenticationDefaults.AuthenticationScheme, userPrincipal, new AuthenticationProperties { //ExpiresUtc = DateTime.UtcNow.AddMinutes(20), ExpiresUtc = DateTime.UtcNow.AddMinutes(1), IsPersistent = true,//在瀏覽器持久化,false的時候走session持久化 AllowRefresh = true//動態刷新令牌 });