Taxum / @taxum/cookie / cookieJar
Variable: cookieJar
Defined in: extract.ts:25
Extractor that grabs cookies from the request and returns a CookieJar.
When making modifications to the cookie jar, you need to return the jar in the response. Any modified or removed cookies will yield a Set-Cookie
header in the response.
Example
ts
import { cookieJar, Cookie } from "@taxum/cookie";
import { extractHandler } from "@taxum/core/routing";
const handler = extractHandler(cookieJar, (jar) => {
jar.add(new Cookie("foo", "bar"));
return [jar, ""];
});