You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
1012 B

4 years ago
<?php
/**
* Created by xiaofu.qin
* Description: 销毁session,要不然调试的时候每次都要关掉浏览器太难受了
*/
session_start();
define('FINEREPORT', '100');
require_once '../myFunc/randomChars.php';
require_once '../ucenter_syn_login_and_logout_api.php';
//其他应用通知当前应用下线的时候就不需要在通知一遍了,因为当其他应用通知下线的时候,synUid这个session会变成-10
if( isset($_SESSION['synUid']) && $_SESSION['synUid'] < 0 ) {
print '';
}else {
syn_logout();
}
#清空session信息
$_SESSION = array();
#清除客户端sessionid
if(isset($_COOKIE[session_name()])) {
setcookie(session_name(),'',time()-3600,'/');
}
#彻底销毁session
session_destroy();
/*$script = <<<str
<script>
location.href = '../login/login.php';
</script>
str;*/
$script = "<script>location.href = '../login/login.php".((isset($_GET['referrer']) && strlen($_GET['referrer'])>0)? "?referrer=".$_GET['referrer']: "")."';</script>";
echo $script;