diff --git a/chrome/content/zotero/xpcom/cookieSandbox.js b/chrome/content/zotero/xpcom/cookieSandbox.js index 6bd08128f6..4832b074b0 100755 --- a/chrome/content/zotero/xpcom/cookieSandbox.js +++ b/chrome/content/zotero/xpcom/cookieSandbox.js @@ -60,6 +60,10 @@ Zotero.CookieSandbox = function (browser, uri, cookieData, userAgent) { } }; +Zotero.CookieSandbox.init = function () { + Zotero.CookieSandbox.Observer.register(); +}; + /** * Normalizes the host string: lower-case, remove leading period, some more cleanup * @param {String} host; @@ -232,8 +236,8 @@ Zotero.CookieSandbox.prototype = { cookies = {}, found = false, secure = uri.scheme.toUpperCase() == 'HTTPS'; // Fetch cookies starting from the highest level domain - var cookieHost = '.' + hostParts[hostParts.length-1]; - for(var i=hostParts.length-2; i>=0; i--) { + var cookieHost = ''; + for(var i=hostParts.length-1; i>=0; i--) { cookieHost = '.' + hostParts[i] + cookieHost; if(this._cookies[cookieHost]) { found = this._getCookiesForPath(cookies, this._cookies[cookieHost], pathParts, secure, i==0) || found; diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js index e8e944df2e..e110bbac76 100644 --- a/chrome/content/zotero/xpcom/zotero.js +++ b/chrome/content/zotero/xpcom/zotero.js @@ -716,6 +716,7 @@ Services.scriptloader.loadSubScript("resource://zotero/polyfill.js"); Zotero.Streamer.init(); Zotero.MIMETypeHandler.init(); + Zotero.CookieSandbox.init(); yield Zotero.Proxies.init(); // Initialize keyboard shortcuts