From 8ee5ef4ab6a233e4c76cce0ddc5269bd85e79211 Mon Sep 17 00:00:00 2001 From: Jakub Skoczen Date: Thu, 12 Jun 2014 12:52:24 +0200 Subject: [PATCH] Use windowId when storing session cookie --- js/pz2.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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 { -- 1.7.10.4