ciao ragazzi avevo bisogno di una semplice informazione che non riesco a capire ho questo codice qui :
//Questo legge se ce gia un cookie

function WM_readCookie(name) {
if(document.cookie == '') {
// there's no cookie, so go no further
return false;
} else {
// there is a cookie
var firstChar, lastChar;
var theBigCookie = document.cookie;
firstChar = theBigCookie.indexOf(name);
// find the start of 'name'
var NN2Hack = firstChar + name.length;
if((firstChar != -1) && (theBigCookie.charAt(NN2Hack) == '=')) { // if you found the cookie
firstChar += name.length + 1; // skip 'name' and '='
lastChar = theBigCookie.indexOf(';', firstChar);
// find the end of the value string (i.e. the next ';').
if(lastChar == -1) lastChar = theBigCookie.length;
return unescape(theBigCookie.substring(firstChar, lastChar));
} else {
// if there was no cookie of that name, return false
return false;
}
}
}

//QUESTO ME NE IMPOSTA UNO SE ANcORA NN CE NE SONO
function setCookie(){
var the_date = new Date("December 21, 2012");
var the_cookie_date = the_date.toGMTString();
var the_cookie = "my_cookie=yes;expires=" + the_cookie_date;
document.cookie = the_cookie;
}
//QUESTO LEGGE SE é LA PRIMA VOLTA CHE MI CONNETTO
function CheckTime(){
var check = WM_readCookie("my_cookie");
if(check == false){
alert("Benvenuto questo è la tua prima visita!!");
setCookie();
}
}

La mia domanda è ma io ho impostato questa stringa: var the_cookie = "my_cookie=yes;expires=" + the_cookie_date; nella funzione setCookie(); e quindi perchè quando in CheckTime nella variabile check inserisco (my_cookie=yes) non mi imposta il cookie ma devo mettere solo my_cookie mentre io l ho chiamato my_cookie = yes e perchè devo metterci lo yes dopo = ? grazie delle risposta