How to use the tough-cookie.permutePath 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;
    })
}

util.inherits(FileCookieStore, Store);
exports.FileCookieStore = FileCookieStore;
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');

        this.cookies = this._loadFromDisk();
    }