cookie troubles

Discussion in 'OT Technology' started by Thrasher, Apr 11, 2004.

  1. Thrasher

    Thrasher Guest

    I'm redesigning one of my websites and I want to set a cookie to know where the visitor is on my website. It works in IE but it doesn't work in Mozilla at least not with the cookie setting "Enable cookies based on privacy settings". While other websites can set a cookie with the same setting. When I set cookies in Mozilla to "Enable all cookies" or "Enable cookies for the originating website only" it works.

    Is there a cookie attribute that I need to set in the cookie so that it will work with the "Enable cookies based on privacy settings"-setting?

    This is the code I use for setting the cookie:
    function writeCookie(name, value, hours)
       var expire = "";
       if(hours != null)
     	expire = new Date((new Date()).getTime() + hours * 3600000);
     	expire = ";expires=" + expire.toGMTString();
       document.cookie = name + "=" + escape(value) + expire;

Share This Page