Skip to main content

Function: cookieAuth()

cookieAuth(): AuthStrategy & object

Defined in: packages/client/src/core/auth.ts:399

Session-cookie authentication. In a browser, relies on the browser's own cookie jar and reads the CSRF token from window/document. In Node, owns an in-memory cookie jar (populated by the transport from set-cookie response headers) and forwards Cookie + CSRF headers itself.

One cookieAuth() instance holds one session. Do not share it across users; call cookieAuth() again (or client.withAuth(...)) to get an isolated session.

Returns

AuthStrategy & object