几种清除 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);
时间: 2024-09-07 17:09:32