ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Cookie Path issues

April 10, 2014 11:58pm

Subscribe [1]
  • #1 / Apr 10, 2014 11:58pm

    Trumpet

    19 posts

    I’m trying to set a cookie path via javascript.  I have it set to ‘/’. However when I view the cookie in the Chrome web inspector, It is setting the path to be the last segment.

    E.g.  About/people/joe

    The path would be “people” and the cookie would be specific to all pages in that directory.  A cookie with the same name would be different on the home page.  I need the cookie to be the same across the entire site.

    function setCookie(cname,cvalue,exdays, path, domain)
    {
    var d = new Date();
    d.setTime(d.getTime()+(exdays*24*60*60*1000));
    var expires = "expires="+d.toGMTString();
    [removed] = cname + "=" + cvalue + "; " + expires + "; " + "path='/'" + domain;
    
    
    }

    I’ve tried many different way and set the EE cookie path to ‘/’ with no luck

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases