How do I remove/delete/expire a cookie immediately?

Posted by dsimard on Stack Overflow See other posts from Stack Overflow or by dsimard
Published on 2009-10-28T08:45:50Z Indexed on 2010/06/09 3:22 UTC
Read the original article Hit count: 249

Filed under:

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?

© Stack Overflow or respective owner

Related posts about cookies