I've a problem with cookie. This is the code that retrieve the cookie (and has some actions on it):
var crtg_cookiename = "cto_zodiak";
var crtg_varname = "crtg_content";
function crtg_getCookie(c_name) {
var i, x, y, ARRCookies = document.cookie.split(";");
for ( i = 0; i < ARRCookies.length; i++) {
x = ARRCookies[i].substr(0, ARRCookies[i].indexOf("="));
y = ARRCookies[i].substr(ARRCookies[i].indexOf("=") + 1);
x = x.replace(/^\s+|\s+$/g, "");
if (x == c_name) {
return unescape(y);
}
}
return '';
}
var crtg_content = crtg_getCookie(crtg_cookiename);
I try this code inside chrome and firefox console: in firefox I can retrieve the cookie and process it but in chrome document.cookie doesn't return anything. Anyone has an idea of the reason?
Thanks in advance