我试图找出下面这段代码有什么问题,每当我尝试使用 Internet Explorer 注销时,我都无法做到这一点,它只会在多次重新加载或关闭浏览器后注销。
<?php
//Start session
session_start();
require("../../class-settings.php");
function write_at_sess_destroy(){
$time=date('h:i:s A',time());
$sql="update " . DB_PRE."user_master set `guid` = '',`user_first_login`='0' WHERE user_id ='". $_SESSION['user']."'";
$sql_log= "update " . DB_PRE."user_log set logout_time='$time' where user_id='{$_SESSION['user']}' and logger_id='{$_SESSION['DYNAMIC_LOGGER_ID']}'";
if(mysql_query($sql))if(mysql_query($sql_log)) return true;
}
if(write_at_sess_destroy()){
function unset_sessions(){
session_start();
if($_SESSION['adminlang'])unset($_SESSION['adminlang']);
unset($_SESSION['loginID']);
unset($_SESSION['utype']);
return true;
}
if(session_destroy()){
header("Location:../../../");
exit;
}
else{
echo "error...";
}
}
?>