HttpContext.Authentication.SignOutAsync does not delete auth cookie

前端 未结 8 1028
温柔的废话
温柔的废话 2020-12-10 10:16

According to ASP.NET Core documentation the method HttpContext.Authentication.SignOutAsync() must delete the authentication cookie as well.

8条回答
  •  一生所求
    2020-12-10 11:14

    Maybe your case was to use ASP NET Core Identity authentication stuff like in my case

    so, instead of using HttpContext.Authentication.SignOutAsync() or HttpContext.SignOutAsync() you can try to use API from ASP NET Identity:

    SignInManager.SignOutAsync()

    API from HttpContext didn't clear cookies with names starting with ".AspNetCore."

    (to use SignInManager you need to bring in SignInMbanager by asp net core's DI)

提交回复
热议问题