Delete the given cookie.
The domain and path options should match what was used to set the cookie. See nukeCookie for a way to delete cookies with all permutations of domains, subdomains, paths, and subpaths.
nukeCookie
the cookie name
Optional
cookie options
Error if called during SSR
import { deleteCookie } from "@trashpanda001/helpers/cookie"deleteCookie("foo")// Set-Cookie: foo=; Path=/; Secure; Same-Site=Lax; Max-Age=0deleteCookie("bar", { domain: "example.com" })// Set-Cookie: foo=; Domain=example.com; Path=/; Secure; Same-Site=Lax; Max-Age=0 Copy
import { deleteCookie } from "@trashpanda001/helpers/cookie"deleteCookie("foo")// Set-Cookie: foo=; Path=/; Secure; Same-Site=Lax; Max-Age=0deleteCookie("bar", { domain: "example.com" })// Set-Cookie: foo=; Domain=example.com; Path=/; Secure; Same-Site=Lax; Max-Age=0
Delete the given cookie.
The domain and path options should match what was used to set the cookie. See
nukeCookie
for a way to delete cookies with all permutations of domains, subdomains, paths, and subpaths.