赞
踩
- var hostname=window.location.hostname;
- var arr=hostname.split(".");
- var domainName2=arr[arr.length-2]+"."+arr[arr.length-1];//主域名,例如abc.com
-
- var aCookie = document.cookie.split(";");
- for (var i = 0; i < aCookie.length; i++) {
- var aCrumb = aCookie[i].split("=");
- var key=aCrumb[0].toString();
- //var flag=Cookies.remove(key);
- delCookie(key,domainName2);
- console.log("del cookie:key="+key);
- }
-
- function delCookie(name, domain) {
- document.cookie = name+'='+Cookies.get(name)+';expires='+(new Date(1))+';domain='+domain+';path=/';
- }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。