Question hub
How do I delete a cookie?
The answer
Send a Set-Cookie header with the same name, domain and path as the original, and an expiry in the past or a Max-Age of zero or less. MDN describes this as the way to remove a cookie immediately. If any of the three identifying parts differ, the browser treats it as a different cookie and the original stays. This mismatch is the most common reason a logout appears to work while the user remains logged in.