public static function updateSession(Session $Session, $sessionData) { // check timestamp if (static::$timeout && $Session->LastRequest < time() - static::$timeout) { $Session->terminate(); return false; } else { // update session $Session->setFields($sessionData); $Session->save(); return $Session; } }
public function dispatchAction($action, $params) { if ($action === 'logout') { Session::terminate(); return new ControllerActionRedirect(Router::toBase()); } if (!Session::isLoggedIn()) { list($num, $pwd) = Arr::initList($_REQUEST, ['num' => TYPE_KEY, 'pwd' => TYPE_STRING]); if (!$num || !$pwd || !Session::login($num, $pwd)) { return ControllerDispatcher::renderModuleView(self::MODULE_NAME, 'login', ['formVal' => ['num' => $num]]); } } if (!Session::getLogin()) { Session::terminate(); return new ControllerActionRedirect(Router::toBase()); } return parent::dispatchAction($action, $params); }
public function logout() { Session::terminate(); header('Location: ' . SUBDIR . '/support'); }
public function logout($params = []) { Session::terminate(); header('Location: ' . SUBDIR . '/'); }