在a.asp中通过SetCookie设置cookies 
function SetCookie()
{
    document.cookie = "GSName" + "=" + escape(document.form1.GSName.value) + ";";
  document.cookie = "GSListNo" + "=" + escape(document.form1.GSListNo.value) + ";";
  document.cookie = "ZCAdress" + "=" + escape(document.form1.ZCAdress.value) + ";";
  document.cookie = "GSFund" + "=" + escape(document.form1.GSFund.value) + ";";
  document.cookie = "GSTerm" + "=" + escape(document.form1.GSTerm.value) + ";";
  document.cookie = "GSNS" + "=" + escape(document.form1.GSNS.value) + ";";
  document.cookie = "BGAdress" + "=" + escape(document.form1.BGAdress.value) + ";";
  document.cookie = "MDAdress" + "=" + escape(document.form1.MDAdress.value) + ";";
  document.cookie = "GSPhone" + "=" + escape(document.form1.GSPhone.value) + ";";
  document.cookie = "GSFax" + "=" + escape(document.form1.GSFax.value) + ";";
  document.cookie = "GSHttp" + "=" + escape(document.form1.GSHttp.value) + ";";
  document.cookie = "GSEmail" + "=" + escape(document.form1.GSEmail.value) + ";";
  document.cookie = "GSAP" + "=" + escape(document.form1.GSAP.value) + ";";
  document.cookie = "GSSW" + "=" + escape(document.form1.GSSW.value) + ";";
  document.cookie = "GSZCPhone" + "=" + escape(document.form1.GSZCPhone.value) + ";";
  document.cookie = "GSBank" + "=" + escape(document.form1.GSBank.value) + ";";
  document.cookie = "GSAccount" + "=" + escape(document.form1.GSAccount.value) + ";";
      
}
在b.asp中在页面载入时删除所设置的cookies
<body onload="CDel()">
....
<script language="JavaScript">
<!--
function CDel()
{
 var arr;
 var strCookie=document.cookie;
 var arrCookie=strCookie.split(";");
 var date=new Date();
 //alert(date);
 date.setTime(date.getTime()-10000);
 //alert(date);
 for(var i=0;i<arrCookie.length;i++)
 { 
   arr=arrCookie[i].split("=");
   switch(arr[0])
   {
    case "GSName":
         document.cookie=arr[0]+"="+"v;expires="+date.toGMTString()+ ";";
         break;
    case "GSListNo":
         document.cookie=arr[0]+"="+"v;expires="+date.toGMTString()+ ";";
         break;
    case "ZCAdress":
         document.cookie=arr[0]+"="+"v;expires="+date.toGMTString()+ ";";
         break;
    case "GSFund":
         document.cookie=arr[0]+"="+"v;expires="+date.toGMTString()+ ";";
         break;
    case "GSTerm":
         document.cookie=arr[0]+"="+"v;expires="+date.toGMTString()+ ";";
         break;
    case "GSNS":
         document.cookie=arr[0]+"="+"v;expires="+date.toGMTString()+ ";";
         break;
    case "BGAdress":
         document.cookie=arr[0]+"="+"v;expires="+date.toGMTString()+ ";";
         break;
    case "MDAdress":
         document.cookie=arr[0]+"="+"v;expires="+date.toGMTString()+ ";";
         break;
    case "GSPhone":
         document.cookie=arr[0]+"="+"v;expires="+date.toGMTString()+ ";";
         break;
    case "GSFax":
         document.cookie=arr[0]+"="+"v;expires="+date.toGMTString()+ ";";
         break;
    case "GSHttp":
         document.cookie=arr[0]+"="+"v;expires="+date.toGMTString()+ ";";
         break;
    case "GSEmail":
         document.cookie=arr[0]+"="+"v;expires="+date.toGMTString()+ ";";
         break;
    case "GSAP":
         document.cookie=arr[0]+"="+"v;expires="+date.toGMTString()+ ";";
         break;
    case "GSSW":
         document.cookie=arr[0]+"="+"v;expires="+date.toGMTString()+ ";";
         break;
    case "GSZCPhone":
         document.cookie=arr[0]+"="+"v;expires="+date.toGMTString()+ ";";
         break;
    case "GSBank":
         document.cookie=arr[0]+"="+"v;expires="+date.toGMTString()+ ";";
         break;
    case "GSAccount":
         document.cookie=arr[0]+"="+"v;expires="+date.toGMTString()+ ";";
         break;    
   } 
 }
}
// -->
</script>
</body>
结果只有“GSName"被删除了,但其它的还在,错在哪里?