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

x/ayonli_jsext/http.ts>getCookie

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

Gets the cookie by the given name from the Cookie header of the request or the Set-Cookie header of the response.

Examples

Example 1

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

export default {
    fetch(req: Request) {
        const cookie = getCookie(req, "foo");
        console.log(cookie);

        return new Response("Hello, World!");
    }
}

Parameters

name: string