1.0.1 • Published 4 years ago

cookied v1.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

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'