Overview of the jsfast cookie module
The
cookie module is a safe wrapper around document.cookie that automatically handles encodeURIComponent for names and values. It supports standard cookie attributes like Max-Age, expires, path, domain, secure, and SameSite. It is SSR-safe: if document is missing (e.g., in Node.js), reads return null and writes are silently skipped without throwing errors.import { cookie } from "jsfast";