jQuery Cookie path

I had the same problem but I found that this occurs only when I minify the jquery.cookie.js and when I put in

config.defaults = {expires: 180, path:'/', domain: '.domain.com' };

it sets the cookie path to '/', whatever internal page is loaded, e.g., yourdomain.com/en/page1/page - cookie path = '/'


I just had the same problem. I fixed it by always specifying the path when writing the cookie.

$.cookie('basket', value, { path: '/' })

This is an issue with the jquery cookie plugin. It will default to the path of the current page.


In the plugin file change:

config.defaults = {};

to

config.defaults = {path:'/'};

from https://github.com/carhartl/jquery-cookie/issues/2#issuecomment-790288