Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/netzo/deps/deno_kv_oauth/deps.ts>getSetCookies

Full-stack Deno framework for building business web apps like internal tools, dashboards, admin panels and automated workflows.
Go to Latest
function getSetCookies
import { getSetCookies } from "https://deno.land/x/netzo@0.5.65/deps/deno_kv_oauth/deps.ts";

Parse set-cookies of a header

Examples

Example 1

import { getSetCookies } from "https://deno.land/std@0.224.0/http/cookie.ts";

const headers = new Headers([
  ["Set-Cookie", "lulu=meow; Secure; Max-Age=3600"],
  ["Set-Cookie", "booya=kasha; HttpOnly; Path=/"],
]);

const cookies = getSetCookies(headers);
console.log(cookies); // [{ name: "lulu", value: "meow", secure: true, maxAge: 3600 }, { name: "booya", value: "kahsa", httpOnly: true, path: "/ }]

Parameters

headers: Headers

The headers instance to get set-cookies from

Returns

List of cookies