From d993e82e844af77df421937d393260712dd0eaf8 Mon Sep 17 00:00:00 2001 From: Andrea Marchesini Date: Tue, 20 Sep 2016 07:53:00 +0200 Subject: [PATCH] nsICookieManager and OriginAttributes: fix issue #4241 --- src/chrome/content/code/Cookie.js | 4 ++-- src/chrome/content/code/HTTPS.js | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/chrome/content/code/Cookie.js b/src/chrome/content/code/Cookie.js index 4fb35e62ecf7..bfd1d9235eca 100644 --- a/src/chrome/content/code/Cookie.js +++ b/src/chrome/content/code/Cookie.js @@ -119,8 +119,8 @@ Cookie.prototype = { }, save: function() { this.save = ("cookieExists" in this.cookieManager) - ? function() { this.cookieManager.add(this.host, this.path, this.name, this.value, this.secure, this.httponly, this.session, this.expires); } - : function() { this.cookieManager.add(this.host, this.path, this.name, this.value, this.secure, this.session, this.expires);} + ? function() { this.cookieManager.add(this.host, this.path, this.name, this.value, this.secure, this.httponly, this.session, this.expires, {});} + : function() { this.cookieManager.add(this.host, this.path, this.name, this.value, this.secure, this.session, this.expires, {});} ; return this.save(); }, diff --git a/src/chrome/content/code/HTTPS.js b/src/chrome/content/code/HTTPS.js index 1ba27b4a0101..ccff0252fc0b 100644 --- a/src/chrome/content/code/HTTPS.js +++ b/src/chrome/content/code/HTTPS.js @@ -161,8 +161,9 @@ const HTTPS = { .getService(Components.interfaces.nsICookieManager2); //some braindead cookies apparently use umghzabilliontrabilions var expiry = Math.min(c.expiry, Math.pow(2,31)); - cookieManager.remove(c.host, c.name, c.path, false); - cookieManager.add(c.host, c.path, c.name, c.value, true, c.isHTTPOnly, c.isSession, expiry); + cookieManager.remove(c.host, c.name, c.path, false, c.originAttributes); + cookieManager.add(c.host, c.path, c.name, c.value, true, c.isHTTPOnly, + c.isSession, expiry, c.originAttributes); } },