cookie-manage
v0.0.5
Published
Simple library to deal with cookies.
Downloads
4
Readme
Cookie Manager
How to use
Install
# npm install
npm install cookie-manager --save
Import
import {Cookie} from 'cookie-manager';
Options
get(name: string): (string | null) {}
- Get a single cookie by it's name
getAll(isObject: boolean = true): (Object | string) {}
- Get all cookies
set(name, value, expires?, path?, domain?, secure?): boolean
- date range: end date
name(string)
: Cookie's identificationvalue(string)
: Cookie's valueexpires(number)
number
: limited or Infinitystring
: string for expiresDate
: Date object or nullpath(string)
: Path relative to the domain where the cookie should be avaiable. Default /
domain(string)
: Domain where the cookie should be avaiable. Default current domainsecure(boolean)
: If true, the cookie will only be available through a secured connection
remove(name: string, path?: string, domain?: string)
- Remove a single cookie
removeAll(path?: string, domain?: string)
- Remove all cookies