Skip to content

Latest commit

 

History

History
26 lines (22 loc) · 648 Bytes

README.md

File metadata and controls

26 lines (22 loc) · 648 Bytes

CookieManager

Simple JS cookie manager

Install

ES5

<script src="https://cdn.jsdelivr.net/npm/@thibka/[email protected]/cookie-manager.es5.min.js"></script>

NPM

npm i @thibka/cookie-manager
import CookieManager from '@thibka/cookie-manager';

Usage

CookieManager.setCookie('myCookie', 'Hello.');

// Optionnaly you can set a duration in days
CookieManager.setCookie('myCookie', 'Hello.', 12); // will expire in 12 days
CookieManager.setCookie('myCookie', 'Hello.', 1/24); // will expire in 1 hour

var myCookie = CookieManager.getCookie('myCookie'); // Returns "Hello."