Home ·  About ·  Search ·  Contact ·  SiteCatalyst Plugins ·  Web Analytics Books




Server Herder - January 21st, 2010 @1:57 pm  

This code is subject to an infinite recursion error when the same cookie is set but in a different path due to the manner in which it finds the current cookie value.

This will trigger the error:

var
/* Sets the s_pers cookie in the .domain.com and path = / */
_i= s.getVisitNum()
/* Read the value */
,_o= s.c_r(“s_pers”)
/* Sets the expiration time of the s_invisit attribute to 1 and encodes it */
, _c= encodeURIComponent(_o.replace(/s_invisit=true\|\d+/, “s_invisit=true|1″))
;
/* sets a new cookie called s_pers in the current path and current domain */
document.cookie=”s_pers=” + _c + “;”

/* Infinite recursion triggered here */
s_ut.c_r(“s_invisit”);

Please Note: comments maybe under moderation so there is no need to resubmit your comments. Feel free to subscribe to this post's comment rss feed for future updates