Authored by whb

PC同步

... ... @@ -545,9 +545,14 @@ class WebAction extends Controller_Abstract
$uid = $this->getUid(true);
//是否同步了session
$sysUserSession = intval($this->getSession('_SYS_USER_SESSION'));
//同步session时间
$sysUserSessionTime = $this->getSession('_SYS_USER_SESSION_TIME');
if(empty($sysUserSession)) {
$sysUserSession = 1;
}
if(empty($sysUserSessionTime)) {
$sysUserSessionTime = 0;
}
if (!empty($channel)) {//设置频道
//\Index\HomeModel::setSwitchToCookie($channel);
}
... ... @@ -568,6 +573,10 @@ class WebAction extends Controller_Abstract
$header['sysUserSession'] = Helpers::syncUserSession($uid);
$sysUserSession = $sysUserSession + 1;
$this->setSession('_SYS_USER_SESSION', $sysUserSession);
$this->setSession('_SYS_USER_SESSION_TIME', time());
} //一个小时同步一次
else if(!empty($uid) && (time() - $sysUserSessionTime) >= 3600) {
$this->setSession('_SYS_USER_SESSION', 0);
}
else if(empty($uid) && $sysUserSession >= 20) {
$this->setSession('_SYS_USER_SESSION', 0);
... ...