Skip to content

Delete a Cookie with JavaScript

Advertisements

To delete a cookie, you just have to set the expires parameter to a passed date. Simple.

document.cookie = "username=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
Advertisements

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.