<div class="exit" οnclick="exit();">退出</a>
.exit{
color:#32a5e8;
font-size:24px;
float:right;
line-height:65px;
width:25px;
margin-right:25%;
white-space:nowrap;
cursor:pointer;
}
function exit(){
var msg = "您真的确定要退出吗?\n\n请确认!";
location=confirm(msg)?"login.php?act=exit":"#";
}
class storage{
public function logout(){
$_SESSION = array(); //清除SESSION值.
if(isset($_COOKIE[session_name()])){ //判断客户端的cookie文件是否存在,存在的话将其设置为过期.
setcookie(session_name(),'',time()-1,'/');
}
session_destroy(); //清除服务器的sesion文件
foreach($_COOKIE as $key=>$value){
setCookie($key,"",time()-3600);//清除服务器的cookies文件
}
}
public function deletecookiename($cookiename){
setcookie($cookiename, "", time() - 3600);
}
}