I want to remove a cookie I set. If I do this by giving it a expiration date sometime in the past it gets marked as “expires: at end of session”. I’ve noticed that other sites manage to delete the cookie immediately somehow. For example when you logout here on stackoverflow the “user” cookie disappears right away. How?
Share
You can’t really influence how and when the browser will destroy expired cookies.
I presume here on SO after you logout, there is a redirect issued, so the browser gets an opportunity to delete the cookie right now.