← Back to index
function getCookies

Parse cookies of a header

Examples

🔗

Example 1

import { getCookies } from "https://deno.land/std@$STD_VERSION/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

Return Type

🔗
Record<string, string>

Object with cookie names as keys