I just had the same problem. I fixed it by always specifying the path when writing the cookie.
$.cookie('basket', value, { path: "https://stackoverflow.com/" })
This is an issue with the jquery cookie plugin. It will default to the path of the current page.