清除cookie

function clearCookie(){
if(document.cookie.length < 2048){
return;
}
//cookie大于2kb,清除cookie
var cookies =document.cookie.replace(/\s*/g,'').split(';');
var cookieNameArr=$.map(cookies,function(e){
return e.split('=')[0];
})
$.each(cookieNameArr,function(i,name){
var cookiePre = name + "=;expires="+new Date(new Date()-1* 24 * 60 * 60 * 1000).toUTCString()+";path=/;";
document.cookie = cookiePre;//IE下支持
document.cookie = cookiePre + "domain=.lenovo.com.cn;";
document.cookie = cookiePre +"domain=robot.lenovo.com.cn;";
if($.browser.mozilla){
document.cookie = cookiePre.replace("path=/;",'path=/lenovo/;');
document.cookie = cookiePre.replace("path=/;",'path=/robot;') +"domain=robot.lenovo.com.cn;";
}
});
}
上一篇:opencv3.1包安装


下一篇:嵌套表SHAPE