@superherocheesecake/cookie

3.0.5 • Public • Published

Cookie

Small helper for Cookie management

Get the package

npm i --save @superherocheesecake/cookie

Import

import { cookie } from '@superherocheesecake/cookie';

Basic Usage

cookie.set(name, value, options); 
cookie.get(name); // returned values will always be strings
cookie.remove(name);

Options

path

default is /

path=path

domain

domain=domain

max-age

max-age=max-age-in-seconds

expires

Use this if you want to set an expiry date. If you don't set this value it will be a session cookie.

expires=date-in-GMTString-format

samesite

samesite='secure'|'lax'

Methods

Convert days to UTC

cookie.daysToUTC(30);

Readme

Keywords

none

Package Sidebar

Install

npm i @superherocheesecake/cookie

Weekly Downloads

0

Version

3.0.5

License

none

Unpacked Size

6.07 kB

Total Files

12

Last publish

Collaborators

  • n0cha
  • edwardmediamonks
  • wesleysmulders
  • ksawery.mediamonks
  • vandenhork25
  • johanholwerda
  • renedrie
  • kristemmerman123
  • odin.schwartz
  • bolex222
  • coco_g
  • frontend_shcc
  • alfred_shcc
  • carinashcc
  • lukasfeitsma
  • jameswhite
  • raul.roman
  • jaak.kivinukk