View Full Version : cookie persistence bug

04-07-2008, 04:09 AM
1) Script Title:
Switch Content Script II (icon based)

2) Script URL (on DD):

3) Describe problem:
Script persistance doesn't always work. I'm using the script on every page. At first it appears to work fine, but if you first expand the contents then go to a bunch of pages where it's loaded each page, at some point it will show closed.

Go to another page, it's open, all without ever manually toggling. I took a look at the cookies it looks like it's due to multiple cookies being set and the way the code reads them.

Here's an example Cookie header with the problem, you can see there are multiple insantces of the cookies (icongroup2_d icongroup2_dtrack). I believe the cookie code does a regex search to find the cookie, so I think it's not getting the right cookie.

It looks like maybe it needs to set the cookies differently to avoid multiple instances. I verified this problem on the latest Firefox, Opera and IE 6.

Cookie: icongroup2_d=none; icongroup2_dtrack=7;
icongroup2_d=0; icongroup2_dtrack=7;
__utmb=1933981.27.10.12017231015; __utmc=193993981;

For now I just disabled persistence to avoid irritating my users with the problem.

BTW great site your stuff is awesome very impressed! Thanks so much for all your work.

04-07-2008, 05:13 PM
Well by default, the persistence feature isn't site wide, and local to each directory on your site. If you want to make it site wide, try adding the below changes in red to the following to lines:

document.cookie = name+"="+value+"; expires="+expireDate.toGMTString()+";path=/"

document.cookie = name+"="+value+";path=/"