delete() method of the
CookieStore interface deletes a cookie with the given name or options object. (See below.) The
delete() method expires the cookie by changing the date to one in the past.
var promise = cookieStore.delete(name); var promise = cookieStore.delete(options);
This method requires one of the following:
USVStringwith the name of a cookie.
- An object containing:
url option enables the modification of a cookie scoped under a particular URL. Service workers can obtain cookies that would be sent to any URL under their scope. From a document you may only obtain the cookies at the current URL, so the only valid URL in a document context is the document's URL.
- Thrown if deleting the cookie represented by the given
In this example a cookie is deleted by passing the name to the
let result = cookieStore.delete('cookie1'); console.log(result);
|Cookie Store API |
BCD tables only load in the browser