JavaScript Delete Cookies

In the previous section, we learned the different ways to set and update a cookie in JavaScript. Apart from that, JavaScript also allows us to delete a cookie. Here, we see all the possible ways to delete a cookie.

JavaScript cookies can be deleted.There are 3 ways to delete cookies:

  • By using expires attribute.
  • By using max-age attribute.
  • Directly, by using the web browser.

Example -