/** * Detects if there is concurrent session (i.e. another user logged in with the same current user credentials), * If so, then logout. * */ public function checkSessionConcurrency() { if (Session::userIsLoggedIn()) { // $this->app->log->debug("userIsLoggedIn"); if (Session::isConcurrentSessionExists()) { // TODO: log something... LoginModel::logout(); $this->redirectHome(); exit; } } }
/** * Returns the current state of the user's login * * @return bool user's login status */ public static function isUserLoggedIn() { return Session::userIsLoggedIn(); }