I am setting a cookie in Javascript using the following code :
setCookie('cart_items','product_name');
function setCookie(name,value,days) {
if (days) {
var date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
var expires = "; expires="+date.toGMTString();
}
else var expires = "";
document.cookie = name+"="+value+expires+"; path=/";
}
But the cookie path is not set to root (/) in Chrome. Instead it gets set to the path from where the web page is being executed !!
I tested with IE and FF. It works fine with both these browsers ....
What might be wrong with Chrome or Is it the problem with cookie creation code i am using??
In Chrome ( 16.0.912.63 )
Path: /xxxxxxxx/xxxxxxx
in FF ( 6.0 )
Path: /
in IE (9)
Path: /