Hello,
My question is if I can set a cookie using javascript (and read it)
My first impression is that the code beneath doesn't work If I look in my vista cookie folder, I can not the name off the cookie
function zetCookie(naam,waarde,dagen) {
if (dagen) {
var date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
var verloopdatum = "; expires="+date.toGMTString();
}
else var verloopdatum = "";
document.cookie = naam+"="+waarde+verloopdatum+"; path=/";
}
function readCookie(name) {
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for(var i=0;i < ca.length;i++) {
var c = ca[i];
while (c.charAt(0)==' ') c = c.substring(1,c.length);
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
}
return null;
}
thanks,Richard