From: Jakub Skoczen Date: Thu, 12 Jun 2014 10:52:24 +0000 (+0200) Subject: Use windowId when storing session cookie X-Git-Tag: v1.7.0~5^2~1 X-Git-Url: http://jsfdemo.indexdata.com/?a=commitdiff_plain;h=8ee5ef4ab6a233e4c76cce0ddc5269bd85e79211;p=pazpar2-moved-to-github.git Use windowId when storing session cookie --- diff --git a/js/pz2.js b/js/pz2.js index 59c501d..fb6264c 100644 --- a/js/pz2.js +++ b/js/pz2.js @@ -769,7 +769,7 @@ pz2.prototype = ** AJAX HELPER CLASS *********************************************************** ******************************************************************************** */ -var pzHttpRequest = function (url, errorHandler, cookieDomain) { +var pzHttpRequest = function (url, errorHandler, cookieDomain, windowId) { this.maxUrlLength = 2048; this.request = null; this.url = url; @@ -779,6 +779,7 @@ var pzHttpRequest = function (url, errorHandler, cookieDomain) { this.isXDR = false; this.domainRegex = /https?:\/\/([^:/]+).*/; this.cookieDomain = cookieDomain || null; + this.windowId = windowId || window.name; var xhr = new XMLHttpRequest(); var domain = this._getDomainFromUrl(url); @@ -906,9 +907,9 @@ pzHttpRequest.prototype = //session cookie, resend it var domain = this._getDomainFromUrl(url); if (domain && this._isCrossDomain(domain) && - this.getCookie(domain+":SESSID")) { + this.getCookie(domain+":"+this.windowId+":SESSID")) { //rewrite the URL - var sessparam = ';jsessionid=' + this.getCookie(domain+":SESSID"); + var sessparam = ';jsessionid=' + this.getCookie(domain+":"+this.windowId+":SESSID"); var q = url.indexOf('?'); if (q == -1) { url += sessparam; @@ -1020,7 +1021,7 @@ pzHttpRequest.prototype = var jsessionId = this.request.responseXML .documentElement.getAttribute('jsessionId'); if (jsessionId) - this.setCookie(domain+":SESSID", jsessionId); + this.setCookie(domain+":"+this.windowId+":SESSID", jsessionId); } this.callback(this.request.responseXML); } else {