Socket
Socket
Sign inDemoInstall

tough-cookie

Package Overview
Dependencies
1
Maintainers
2
Versions
46
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.10.0 to 0.11.0

2

lib/memstore.js

@@ -94,3 +94,3 @@ var tough = require('./cookie');

MemoryCookieStore.prototype.removeCookies = function removeCookies(domain, path, cb) {
if (!this.idx[domain]) {
if (this.idx[domain]) {
if (path) {

@@ -97,0 +97,0 @@ delete this.idx[domain][path];

@@ -16,3 +16,3 @@ {

],
"version": "0.10.0",
"version": "0.11.0",
"homepage": "https://github.com/goinstant/node-cookie",

@@ -19,0 +19,0 @@ "repository": {

@@ -1411,2 +1411,45 @@ /*

})
.addBatch({
"remove cookies": {
topic: function() {
var jar = new CookieJar();
var cookie = Cookie.parse("a=b; Domain=example.com; Path=/");
var cookie2 = Cookie.parse("a=b; Domain=foo.com; Path=/");
var cookie3 = Cookie.parse("foo=bar; Domain=foo.com; Path=/");
jar.setCookie(cookie, 'http://example.com/index.html', function(){});
jar.setCookie(cookie2, 'http://foo.com/index.html', function(){});
jar.setCookie(cookie3, 'http://foo.com/index.html', function(){});
return jar;
},
"all from matching domain": function(jar){
jar.store.removeCookies('example.com',null, function(err) {
assert(err == null);
jar.store.findCookies('example.com', null, function(err, cookies){
assert(err == null);
assert(cookies != null);
assert(cookies.length === 0, 'cookie was not removed');
});
jar.store.findCookies('foo.com', null, function(err, cookies){
assert(err == null);
assert(cookies != null);
assert(cookies.length === 2, 'cookies should not have been removed');
});
});
},
"from cookie store matching domain and key": function(jar){
jar.store.removeCookie('foo.com', '/', 'foo', function(err) {
assert(err == null);
jar.store.findCookies('foo.com', null, function(err, cookies){
assert(err == null);
assert(cookies != null);
assert(cookies.length === 1, 'cookie was not removed correctly');
assert(cookies[0].key === 'a', 'wrong cookie was removed');
});
});
}
}
})
.export(module);
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc