Напишите печенье, а затем прочитайте его ...
например:
function readCookie(cname) {
a = trim(document.cookie);
res = '';
while(a != '') {
cookiename = a.substring(0,a.search('='));
cookiewert = a.substring(a.search('=')+1,a.search(';'));
if(cookiewert == '' || a.search(';')==-1) {
cookiewert = a.substring(a.search('=')+1,a.length);
} else {
cookiewert = a.substring(a.search('=')+1,a.search(';'));
}
if(cname == trim(cookiename)){
res = cookiewert;
return (res);
}
i = a.search(';')+1;
if(i == 0){i = a.length}
a = a.substring(i,a.length);
}
return(res)
}
function checkSessionCookie() {
//write cookie
document.cookie = 'sessioncookieallowed=true;';
var check = readCookie('sessioncookieallowed');
}
вызов функции checkSessionCookie ();