var cookieUtil = {
//建立cookie
setCookie:function(name,value,iDate){
var date = new Date();
date.setDate(date.getDate()+iDate);
document.cookie = name+"="+value+";expires="+date +";path=/";
},
//获取cookie
getCookie:function(name){
var str = document.cookie;
//console.log(str);
var arr= str.split("; ");
for(var i=0;i<arr.length;i++){
var arr1 = arr[i].split("=");
if(arr1[0]==name){
return arr1[1];
}
}
return "";
},
//移除cookie
removeCookie:function(sname){
this.setCookie(sname,2,-1)
}
};