0.0.5 • Published 7 years ago

cookie-manage v0.0.5

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

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 identification - value(string): Cookie's value - expires(number)
      • number: limited or Infinity
      • string: string for expires
      • Date: Date object or null
        - path(string): Path relative to the domain where the cookie should be avaiable. Default /
    • domain(string): Domain where the cookie should be avaiable. Default current domain - secure(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