赞
踩
//清除所有cookie函数
function clearAllCookie() {
var date=new Date();
date.setTime(date.getTime()-10000);
var keys=document.cookie.match(/[^ =;]+(?=\=)/g);
console.log("需要删除的cookie名字:"+keys);
if (keys) {
for (var i = keys.length; i--;)
document.cookie=keys[i]+"=0; expire="+date.toGMTString()+"; path=/";
}
}
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。