How to use the defaultPath function from tough-cookie

Find comprehensive JavaScript tough-cookie.defaultPath code examples handpicked from public code repositorys.

17
18
19
20
21
22
23
24
25
26
MyRequest.prototype.clearCookie = function (url) {
  if (this.j.store) {
    //memstore
    var context = urlParse(url);
    var host = tough.canonicalDomain(context.hostname);
    this.j.store.removeCookies(host, tough.defaultPath(context.pathname), function () {});
  }
};

MyRequest.prototype.setCookie = function (str_cookie, url) {
fork icon15
star icon41
watch icon2

16
17
18
19
20
21
22
23
24
25
exports.clearCookie = function (url) {
  if (j.store) {
    //memstore
    var context = urlParse(url);
    var host = tough.canonicalDomain(context.hostname);
    j.store.removeCookies(host, tough.defaultPath(context.pathname), function () {});
  }
};

exports.setCookie = function (str_cookie, url) {
fork icon1
star icon5
watch icon4