Skip to content

Deleting cookies

delete() expires a single cookie. deleteAll() expires every cookie the page can see, using the same options for each one.

Live demo
  • Both methods need the path (and domain) the cookie was set with. A cookie set with path: '/' isn’t deleted by delete(name) called on /docs/.
  • deleteAll() can only delete cookies the page can see. HttpOnly cookies and cookies on other paths aren’t touched.
  • Pass partitioned: true to delete partitioned cookies.