@supabase/ssr - v0.12.7
    Preparing search index...

    Function clearAuthCookiesAtScopes

    • One-shot helper to clear Supabase auth cookies at one or more explicit scopes. Use after a deploy that changes cookie Domain, Path, or other scope-affecting options, to remove stale cookies that the runtime signOut cannot reach because they live at a different scope.

      The helper issues a Set-Cookie with Max-Age=0 for every known chunk of the given storageKey at each scope. The browser silently ignores Set-Cookie attempts for scopes the current host doesn't own, so passing more scopes than necessary is safe — only the ones that actually held stale cookies will have any observable effect.

      For the common host-only -> parent-domain migration, this helper is not required: signOut already clears the host-only counterpart automatically when cookieOptions.domain is set on the current client.

      Parameters

      • input: {
            getAll: (
                keyHints: string[],
            ) =>
                | Promise<{ name: string; value: string }[] | null>
                | { name: string; value: string }[]
                | null;
            setAll: SetAllCookies;
            storageKey: string;
            scopes: Partial<Partial<SerializeOptions>>[];
        }

      Returns Promise<void>

      // After migrating from `.foo.com` to `.bar.com`:
      await clearAuthCookiesAtScopes({
      getAll,
      setAll,
      storageKey: 'sb-<project-ref>-auth-token',
      scopes: [{ domain: '.foo.com' }],
      });
      // Path migration from `/app` to `/`:
      await clearAuthCookiesAtScopes({
      getAll,
      setAll,
      storageKey: 'sb-<project-ref>-auth-token',
      scopes: [{ path: '/app' }],
      });