Public
Script
1
2
3
4
5
6
7
8
9
10
11
12
import { getInflight } from "https://esm.town/v/tmcw/getInflight";
import { InflightCookies } from "https://esm.town/v/tmcw/InflightCookies";
import { Context } from "npm:hono@3.8.1";
import { getCookie as _getCookie, setCookie as _setCookie } from "npm:hono@3.8.1/cookie";
/** Set a cookie and keep track of it inflight */
export function setCookie(c: Context, key: string, value: string) {
const inflight = getInflight(c);
inflight.set(key, value);
InflightCookies.set(c, inflight);
_setCookie(c, key, value);
}
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
November 16, 2023