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.
$ npm install tough-cookie-file-store
var cookieStore = require('tough-cookie-file-store');
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');
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');
var j = request.jar(new cookieStore('./cookie.json'));
request = request.defaults({ jar : j })
request('http://www.google.com', function() {
request('http://images.google.com')
})
tough-cookie-filestore module: @mitsuru
fixes/improvements: @sarkian @mudkipme @vladh
expired feature: @zhzehong
MIT