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

x/ayonli_jsext/esm/http.js>parseCookie

A JavaScript extension package for building strong and modern applications.
Latest
function parseCookie
import { parseCookie } from "https://deno.land/x/ayonli_jsext@v0.9.72/esm/http.js";

Parses the Set-Cookie header.

Examples

Example 1

import { parseCookie } from "@ayonli/jsext/http";

const cookie = parseCookie("foo=bar; Domain=example.com; Path=/; Expires=Wed, 09 Jun 2021 10:18:14 GMT; HttpOnly; Secure; SameSite=Strict");
console.log(cookie);
// {
//     name: "foo",
//     value: "bar",
//     domain: "example.com",
//     path: "/",
//     expires: 1623233894000,
//     httpOnly: true,
//     secure: true,
//     sameSite: "strict"
// }