cookied
v1.0.1
Published
A pair of stupid simple functions for creating and retrieving cookies, based on W3Schools JavaScript cookie tutorial.
Downloads
14
Readme
Cookied
A pair of stupid simple functions for creating and retrieving cookies, based on W3Schools JavaScript cookie tutorial.
Usage
import { getCookie, setCookie } from 'cookied'
// Create a cookie that will expire in 7 days (default 1).
setCookie('my_cookie', 'payload', 7)
// Retrieve the cookie.
const cookie = getCookie('my_cookie') // -> 'payload'