[HttpPost] [ValidateAntiForgeryToken] public async Task<IActionResult> Logout(LogoutFormModel model) { // build a model so the logged out page knows what to display var vm = await BuildLoggedOutViewModelAsync(model.LogoutId); if (User?.Identity.IsAuthenticated == true) { // delete local authentication cookie //await HttpContext.SignOutAsync(); // <-- replace this line await _signInManager.SignOutAsync(); // <-- with this one // raise the logout event await _events.RaiseAsync(new UserLogoutSuccessEvent(User.GetSubjectId(), User.GetDisplayName())); } return View("LoggedOut", vm); }
已成功删除
IdentityServer4 + ASP.NET Identity 无法删除cookie
原文:https://www.cnblogs.com/827648168yj/p/14631476.html