当前位置:编程学习 > asp >>

几种清除 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);

 

补充:asp教程,ASP入门
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,