How to use the tough-cookie.Store function in tough-cookie

To help you get started, we’ve selected a few tough-cookie examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ivanmarban / tough-cookie-file-store / lib / file-store.js View on Github external
'use strict';
var tough = require('tough-cookie');
var Store = tough.Store;
var permuteDomain = tough.permuteDomain;
var permutePath = tough.permutePath;
var util = require('util');
var fs = require('fs');

function FileCookieStore(filePath) {
    Store.call(this);
    this.idx = {}; // idx is memory cache
    this.filePath = filePath;
    var self = this;
    loadFromFile(this.filePath, function(dataJson) {
        if (dataJson)
            self.idx = dataJson;
    })
}
github postmanlabs / postman-sandbox / lib / sandbox / cookie-store.js View on Github external
var _ = require('lodash'),
    util = require('util'),

    Store = require('tough-cookie').Store,
    Cookie = require('tough-cookie').Cookie,

    EXECUTION_EVENT_BASE = 'execution.cookies.',
    EVENT_STORE_ACTION = 'store',
    STORE_METHODS = [
        'findCookie', 'findCookies', 'putCookie', 'updateCookie',
        'removeCookie', 'removeCookies', 'removeAllCookies', 'getAllCookies'
    ],
    FUNCTION = 'function',

    arrayProtoSlice = Array.prototype.slice,
    PostmanCookieStore;

PostmanCookieStore = function PostmanCookieStore (id, emitter, timers) {
    Store.call(this);
github peterjcaulfield / raiden / lib / cookieFilestore.js View on Github external
const tough = require('tough-cookie'),
      Store = tough.Store,
      permuteDomain = tough.permuteDomain,
      permutePath = tough.permutePath,
      fs = require('fs'),
      helpers = require('./helpers'),
      path = require('path');

class CookieFilestore extends Store {

    constructor() {

        super();

        this.synchronous = true;

        this.filePath = path.join(process.env.HOME, '.raiden', 'cookies.json');