In my code I have a drop-down menu that redirects and sets a cookie. The value of one of the options selected is the following:
Redirection works when clicking GO! But when I'm setting the cookie, something strange happens. First, this is what the above chosen value looks like when passed to the server:
Some data is added to the above string, using Javascript, to make a cookie string:
The value of variable TEST ends up looking like this:
Now HERE IS THE CURIOUS PART...when variable TEST gets assigned to document.cookie using Javascript, the value of document.cookie ends up being:
So my question is Where did the "?shopID=COMPANY&null" part go, and why did the order of the arguments change? When redirection is attempted after reading this cookie, it fails, and I suspect it's because the full cookie string is not being assigned to document.cookie. I parse everything correctly and assign the string to window.location, but redirection fails. Can someone tell me why the string is being cut off?
Thanks
Code:
<option value="<isa:webappsURL name="/b2b/init.do"/>?shopId=COMPANY&<%= request.getQueryString() %>">United States</option>
Redirection works when clicking GO! But when I'm setting the cookie, something strange happens. First, this is what the above chosen value looks like when passed to the server:
Code:
/b2b-playground/b2b/init.do;jsessionid=ID4001DB0.9722336212
620123End;sap2ee_*=4001?shopId=COMPANY&null
Some data is added to the above string, using Javascript, to make a cookie string:
Code:
var expiration = new Date("December 1, 2004");
expiration = expiration.toGMTString();
test = "name=" + menuvalue + ";expires=" + expiration;
The value of variable TEST ends up looking like this:
Code:
name=/b2b-playground/b2b/init.do;jsessionid=ID4001DB0.9722336212
620123End;sap2ee_*=4001?shopId=COMPANY&null;expires=Wed, 1 Dec 2004 05:00:00 UTC
Now HERE IS THE CURIOUS PART...when variable TEST gets assigned to document.cookie using Javascript, the value of document.cookie ends up being:
Code:
name=/b2b-playground/b2b/init.do;sap2ee_*=4001; JSESSIONID=ID4001DB0.9520725885913588End
So my question is Where did the "?shopID=COMPANY&null" part go, and why did the order of the arguments change? When redirection is attempted after reading this cookie, it fails, and I suspect it's because the full cookie string is not being assigned to document.cookie. I parse everything correctly and assign the string to window.location, but redirection fails. Can someone tell me why the string is being cut off?
Thanks