I've been reading through the results of a search for the phrase "cookie text" and will now come right out and ask my question. I'm manipulating a file of cookies in IE that are meant to pass the settings of the current page on to the next page to produce similar filtering. I nave been successful in passing and applying most of these settings, but have run into a snag. Below is my cookie code (adapted from prior searches)...
In trying to narrow down the problem on the unsuccessful instances, I have been looking at the contents of the cookie file in the cookie folder. Below is an example...
These two cookie entries are produced with the following code...
...where the nonquoted second argument of each function call is a variable supplied with the appropreiate value. In notepad, the <CR><LF> is displayed as a small portrait rectangle character and the cookie text is one contiguous line.
My question concerns the numbers that follow the cookie name, cookie value, and path. These change due to different factors that I am yet to understand. Can you explain what each part of the trailing numbers represent. I'm trying to determine if it's those trailing number differences that are causing my second page not to properly apply the cookie set down by the first page.
Thanks!
Ray <><
"I was going to change my shirt, but I changed my mind instead." - Winnie the Pooh
Code:
function getCookie(name)
{var arg = name + '=';
var arglen = arg.length;
var acookiejar = new Array();
acookiejar = document.cookie.split('; ');
var cookiecnt = acookiejar.length;
var i = 0;
while (i < cookiecnt)
{if (acookiejar[i].substring(0, arglen) == arg)
{var thecookie = unescape(acookiejar[i]);
var cookielen = thecookie.length;
var thefilling = thecookie.substring(arglen, cookielen);
return thefilling;}
i = i + 1;}
return null;}
function setCookie(name, value)
{var yearsfromnow = new Date();
yearsfromnow.setFullYear(yearsfromnow.getFullYear() + 20);
expires = yearsfromnow;
var curCookie = name + '=' + escape(value);
document.cookie = curCookie;}
In trying to narrow down the problem on the unsuccessful instances, I have been looking at the contents of the cookie file in the cookie folder. Below is an example...
Code:
eacdreplevel
daterange
~~local~~/C:\Documents and Settings\RHeilman\Desktop\
1088
1186005248
31211962
53956688
29742447
*
eacdrepvalue
[Date Ranges End Points].[Since Last EAC]
~~local~~/C:\Documents and Settings\RHeilman\Desktop\
1088
1186005248
31211962
54056688
29742447
*
These two cookie entries are produced with the following code...
Code:
setCookie('eacdreplevel', eacdreplevel);
setCookie('eacdrepvalue', eacdrepvalue);
...where the nonquoted second argument of each function call is a variable supplied with the appropreiate value. In notepad, the <CR><LF> is displayed as a small portrait rectangle character and the cookie text is one contiguous line.
My question concerns the numbers that follow the cookie name, cookie value, and path. These change due to different factors that I am yet to understand. Can you explain what each part of the trailing numbers represent. I'm trying to determine if it's those trailing number differences that are causing my second page not to properly apply the cookie set down by the first page.
Thanks!
Ray <><
"I was going to change my shirt, but I changed my mind instead." - Winnie the Pooh