HttpContext.SignInAsync(
                    CookieAuthenticationDefaults.AuthenticationScheme,
                    userPrincipal,
                    new AuthenticationProperties
                    {
                        //ExpiresUtc = DateTime.UtcNow.AddMinutes(20),
                        ExpiresUtc = DateTime.UtcNow.AddMinutes(1),
                        IsPersistent = true,//在浏览器持久化,false的时候走session持久化
                        AllowRefresh = true//动态刷新令牌
                    });

 

相关文章:

  • 2022-12-23
  • 2021-07-26
  • 2021-11-24
  • 2021-06-21
  • 2021-06-21
  • 2021-10-15
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-02-11
  • 2022-02-13
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案