Skip to content

cath-gh/tough-cookie-store

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

File Cookie Store

NPM build status

tough-cookie-filestore is a File store modified from tough-cookie-filestore, fully compatible with it. And add some functions needed in use.

installation

$ npm install tough-cookie-store

Usage

  var FileCookieStore = require("tough-cookie-store"),
      request = require('request');
  
  var fileStore = new FileCookieStore(filePath, option);
  var jar = request.jar(fileStore);
  var req = request.defaults({jar: jar});

Options

filePath

file path of cookie file.

option

with or without encrypt

option.encrypt

true as default, unless explicitly specified as false fileStore will encrypt the cookie file with the default setting.

option.algorithm

'aes-256-cbc'as default, you can use any algorithm nodejs supported.

option.password

'tough-cookie-store'as default.

API

see tough-cookie#store-api

extra API

fileStore.getCookie(domain, path, key)

sync version of fileStore.findCookie, return a cookie object.

fileStore.flush()

write current cookies to file.

fileStore.isEmpty()

check if fileStore is empty.

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%