1.0.2 • Published 4 years ago

etherio-cookie v1.0.2

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

etherio-cookie

Installation

    npm install etherio-cookie

Usage

//* importing module
const cookie = require('etherio-cookie');

Parse Cookie From String

var cookies = cookie.parse(request.headers.cookie);

or

var cookies = cookie.parse('<cookie-name>=<cookie-value>;<more-cookie>=<more-value>');

Create/Set Cookie

// if u want to add setHeader(cookie) on response, add response variable in second argument
cookies.add({
    name: 'string:required',
    value: 'string:required',
    expires: new Date,
    secure: false,
    httponly: false,
    domain: '*',
    path: '/',
    samesite: 'Las'
}, response);

or

cookie.create({
    name: 'string:required',
    value: 'string:required',
    expires: new Date,
    secure: false,
    httponly: false,
    domain: '*',
    path: '/',
    samesite: 'Las'
});
1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago