diff options
Diffstat (limited to 'devtools/server')
-rw-r--r-- | devtools/server/actors/storage.js | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/devtools/server/actors/storage.js b/devtools/server/actors/storage.js index 6d069939d..6d1e2dc99 100644 --- a/devtools/server/actors/storage.js +++ b/devtools/server/actors/storage.js @@ -628,6 +628,12 @@ StorageActors.createActor({ .originAttributes); }), + removeAllSessionCookies: Task.async(function* (host, domain) { + let doc = this.storageActor.document; + this.removeAllSessionCookies(host, domain, doc.nodePrincipal + .originAttributes); + }), + maybeSetupChildProcess() { cookieHelpers.onCookieChanged = this.onCookieChanged.bind(this); @@ -644,6 +650,8 @@ StorageActors.createActor({ cookieHelpers.removeCookie.bind(cookieHelpers); this.removeAllCookies = cookieHelpers.removeAllCookies.bind(cookieHelpers); + this.removeAllSessionCookies = + cookieHelpers.removeAllSessionCookies.bind(cookieHelpers); return; } @@ -667,6 +675,8 @@ StorageActors.createActor({ callParentProcess.bind(null, "removeCookie"); this.removeAllCookies = callParentProcess.bind(null, "removeAllCookies"); + this.removeAllSessionCookies = + callParentProcess.bind(null, "removeAllSessionCookies"); addMessageListener("debug:storage-cookie-request-child", cookieHelpers.handleParentRequest); @@ -853,7 +863,8 @@ var cookieHelpers = { if (hostMatches(cookie.host, host) && (!opts.name || cookie.name === opts.name) && (!opts.domain || cookie.host === opts.domain) && - (!opts.path || cookie.path === opts.path)) { + (!opts.path || cookie.path === opts.path) && + (!opts.session || (!cookie.expires && !cookie.maxAge))) { Services.cookies.remove( cookie.host, cookie.name, @@ -875,6 +886,10 @@ var cookieHelpers = { this._removeCookies(host, { domain, originAttributes }); }, + removeAllSessionCookies(host, domain, originAttributes) { + this._removeCookies(host, { domain, originAttributes, session: true }); + }, + addCookieObservers() { Services.obs.addObserver(cookieHelpers, "cookie-changed", false); return null; @@ -951,6 +966,12 @@ var cookieHelpers = { let originAttributes = msg.data.args[2]; return cookieHelpers.removeAllCookies(host, domain, originAttributes); } + case "removeAllSessionCookies": { + let host = msg.data.args[0]; + let domain = msg.data.args[1]; + let originAttributes = msg.data.args[2]; + return cookieHelpers.removeAllSessionCookies(host, domain, originAttributes); + } default: console.error("ERR_DIRECTOR_PARENT_UNKNOWN_METHOD", msg.json.method); throw new Error("ERR_DIRECTOR_PARENT_UNKNOWN_METHOD"); |