Results 1 to 2 of 2

Thread: cookie persistence bug

  1. #1
    Join Date
    Apr 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default cookie persistence bug

    1) Script Title:
    Switch Content Script II (icon based)

    2) Script URL (on DD):
    http://www.dynamicdrive.com/dynamici...chcontent2.htm

    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;
    SESS3ed160102ec1b7baf016ecc409d58a5e=4d1b813b16b669b92e8d877f3c51;
    icongroup2_d=0; icongroup2_dtrack=7;
    __utma=1993981.899579.1207227.1207517231.1207227.1;
    __utmb=1933981.27.10.12017231015; __utmc=193993981;
    __utmz=13981.12075231.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)

    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.

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    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:

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

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •