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

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

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

Parse cookies of a header

Examples

Example 1

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

const headers = new Headers();
headers.set("Cookie", "full=of; tasty=chocolate");

const cookies = getCookies(headers);
console.log(cookies); // { full: "of", tasty: "chocolate" }

Parameters

headers: Headers

The headers instance to get cookies from

Returns

Record<string, string>

Object with cookie names as keys