设置,读取,删除
var odate=new Date();
odate.setDate(odate.getDate()+14);
document.cookie='user=blue;expires='+odate;
function setCookie(name,value,iDay){
var odate=new Date();
odate.setDate(odate.getDate()+iday);
document.cookie=name+'='+value+';expires='+odate;
}

function getCookie(name){
var arr=document.cookie.split('; ');
for(var i=0;i<arr.length;i++){
arr2=arr[i].split('=');
if(arr2[0]==name){
return arr2[1];
}
}
return '';
}

function removeCookie(name){
setCookie(name,1,-1);
}

05-11 11:13