I’ve experienced a big problem in my app. The .AspNetCore.Identity.Application cookie isn’t removed from the browser’s cookie storage after logging out the user.
I’ve already searched a lot and found many posts and topics about this issue but I couldn’t fix it yet. I don’t know what to do. I’ve tried a lot:
- await HttpContext.SignOutAsync();
- await HttpContext.SignOutAsync(“Identity.Application”);
- logout without redirect
- await _signInManager.SignOutAsync(); – this function should work alone because it should remove all cookies
I also checked the configuration but I couldn’t find any reason why this is happening.
When the user is logging out, a request is sent to the Account Controller’s logout function:
<code>[HttpPost]
[AllowAnonymous]
public virtual async Task Logout()
{
await _signInManager.SignOutAsync();
}
</code>
<code>[HttpPost]
[AllowAnonymous]
public virtual async Task Logout()
{
await _signInManager.SignOutAsync();
}
</code>
[HttpPost]
[AllowAnonymous]
public virtual async Task Logout()
{
await _signInManager.SignOutAsync();
}
These both cookies always exist after logging out the user.
Does anybody have an idea how I can fix this issue?