Get unlimited public & private packages + package-based permissions with npm Pro.Get started »

This package has been deprecated

Author message:

Deprecated to in favor of tough-cookie-file-store

tough-cookie-file-store-bugfix

0.1.1 • Public • Published

tough-cookie-file-store

NPM

Another file store for tough-cookie module.

The main purpose of this project is to have a published module with the original functionality of tough-cookie-filestore plus various fixes, improvements and features that I found useful.

This fork mainly fixes that cookie path has trailing slash.

Installation

$ npm install tough-cookie-file-store-bugfix

Usage

var cookieStore = require('tough-cookie-file-store-bugfix');
var CookieJar = require('tough-cookie').CookieJar;
var jar = new CookieJar(new cookieStore('./cookie.json'));
 
/* check if cookie is empty or expired */
var cookieStore = require('tough-cookie-file-store-bugfix');
var cookieInstance = new cookieStore('./cookie.json');
cookieInstance.isExpired() // will return True if the cookie is expired
cookieInstance.isEmpty() // will return True is cookie is empty
 
/* request example */
var cookieStore = require('tough-cookie-file-store-bugfix');
var j = request.jar(new cookieStore('./cookie.json'));
request = request.defaults({ jar : j })
request('http://www.google.com', function() {
  request('http://images.google.com')
})

Credits

tough-cookie-filestore module: @mitsuru

fixes/improvements: @sarkian @mudkipme @vladh

expired feature: @zhzehong

License

MIT

Install

npm i tough-cookie-file-store-bugfix

DownloadsWeekly Downloads

0

Version

0.1.1

License

MIT

Last publish

Collaborators

  • avatar