代码 复制 - 运行

var aCookie = document.cookie.split(";");  
  var re = '';  
  for (var i = 0; i < aCookie.length; i++) {  
      var aCrumb = aCookie[i].split("=");  
      if(aCrumb[0].toString().trim()=='order_list'){  
          continue;  
      }  
      re += (aCrumb[0] + " = " + aCrumb[1] + '\n\n');  
  }  
  alert('cookie info:\n'+re);  



js删除所有的cookie的代码

代码 复制 - 运行

function clearCookie(){ 
var keys=document.cookie.match(/[^ =;]+(?=\=)/g); 
if (keys) { 
for (var i = keys.length; i--;) 
document.cookie=keys[i]+'=0;expires=' + new Date( 0).toUTCString() 
} 
}