Skip to content

zero-auth API Documentation v1.6.0


zero-auth API Documentation / clearCookie

Function: clearCookie() ​

clearCookie(res, name, optionsOrPath?): void

Defined in: packages/zero-auth/src/cookies/clearCookie.ts:15

Clears a named cookie from the response.

Sends a Set-Cookie header with an expired Max-Age to instruct the browser to delete the cookie. Attributes should match those used when the cookie was set (path, domain, sameSite, secure).

Parameters ​

res ​

Response

Express response object.

name ​

string

The name of the cookie to clear.

optionsOrPath? ​

string | CookieOptions

Cookie options, or a path string for backward compatibility.

Returns ​

void