萬盛學電腦網

 萬盛學電腦網 >> 網絡編程 >> asp編程 >> 幾種清除cookie有效方法(js,asp,php)

幾種清除cookie有效方法(js,asp,php)

幾種清除 cookie有效方法(網頁特效,asp教程,php教程)
網頁特效設置cookie過期時間
<script language="網頁特效">

 function setcookie(name,days)
 {
  var url = document.domain;
  var exp = new date();
  exp.settime(exp.gettime() + days*24*60*60*1000);
  document.cookie = name + "="+ escape(url) +";expires="+ exp.togmtstring();
 }
setcookie('domain',-1);
</script>

asp清除cookie

response.cookies("mycookie").expires= (now()+1/24)
response.cookies("mycookie").expires = dateadd("h", 1, now())
response.cookies("cookiename").expires=dateadd("m",60,now())
php cookie

setcookie("memusername") 或 setcookie("memusername","",time()-60*60*24*365);
 

copyright © 萬盛學電腦網 all rights reserved