tough-cookie-file-store

A JSON file store for tough-cookie module


Keywords
HTTP, cookie, cookies, set-cookie, cookiejar, jar, RFC6265, RFC2965, store, file, json, cookiestorage, node, node-js, toughcookie-json
License
MIT
Install
npm install tough-cookie-file-store@2.0.3

Documentation

tough-cookie-file-store

NPM

A JSON file store implementation for tough-cookie module

Version npm npm Downloads Tests Status Coverage Status dependencies Status JavaScript Style Guide Donate

Installation

$ npm install tough-cookie-file-store

Usage

const { CookieJar, Cookie } = require('tough-cookie')
const CookieFileStore = require('tough-cookie-file-store').FileCookieStore
const cookieJar = new CookieJar(new CookieFileStore('./cookie.json'))
const cookie = Cookie.parse('foo=bar; Domain=example.com; Path=/')
cookieJar.setCookie(cookie, 'http://example.com', function (error, cookie) {
  console.log(cookie)
})

License

MIT