@trashpanda001/helpers
    Preparing search index...

    Function nukeCookie

    • Delete a cookie with all permutations of domains and subdomains of window.location.hostname and all subpaths of the given path.

      Parameters

      • name: string

        the cookie name

      • Optionalpath: string

        the path to delete the cookie from (default: window.location.pathname)

      Returns void

      Error if called during SSR

      import { nukeCookie } from "@trashpanda001/helpers/cookie"

      nukeCookie("orbit") // on `https://example.com/xy`
      // Set-Cookie: orbit=; Domain=example.com; Secure; Max-Age=0
      // Set-Cookie: orbit=; Domain=example.com; Path=/; Secure; Max-Age=0
      // Set-Cookie: orbit=; Domain=example.com; Path=/x; Secure; Max-Age=0
      // Set-Cookie: orbit=; Domain=example.com; Path=/xy; Secure; Max-Age=0
      // Set-Cookie: orbit=; Domain=com; Secure; Max-Age=0
      // Set-Cookie: orbit=; Domain=com; Path=/; Secure; Max-Age=0
      // Set-Cookie: orbit=; Domain=com; Path=/x; Secure; Max-Age=0
      // Set-Cookie: orbit=; Domain=com; Path=/xy; Secure; Max-Age=0
      // Set-Cookie: orbit=; Secure; Max-Age=0
      // Set-Cookie: orbit=; Path=/; Secure; Max-Age=0
      // Set-Cookie: orbit=; Path=/x; Secure; Max-Age=0
      // Set-Cookie: orbit=; Path=/xy; Secure; Max-Age=0

      It's the only way to be sure.