Skip to content

deleteCookies()

Deletes browser cookies with matching name and URL or domain/path pair. If cookie name is not given or empty, all browser cookies are deleted.

await deleteCookies() # clears all browser cookies
await deleteCookies("CSRFToken", {url: "http://the-internet.herokuapp.com"})
await deleteCookies("CSRFToken", {domain: "herokuapp.com"})
NameTypeDescription
cookieNamestringCookie name. Default: undefined.
optionsObjectDefault: {}.
options.urlstringdeletes all the cookies with the given name where domain and path match provided URL. eg: https://google.com Default: undefined.
options.domainstringdeletes only cookies with the exact domain. eg: google.com Default: undefined.
options.pathstringdeletes only cookies with the exact path. eg: Google/Chrome/Default/Cookies/.. Default: undefined.
TypeDescription
Promise<void>