checkSessionConcurrency() public static method

Detects if there is concurrent session (i.e. another user logged in with the same current user credentials), If so, then logout.
public static checkSessionConcurrency ( )
コード例 #1
0
 function __construct()
 {
     Session::init();
     Auth::checkSessionConcurrency();
     if (!Session::userIsLoggedIn() && Request::cookie('remember_me')) {
         Redirect::to("login/loginWithCookie");
     }
     $this->view = new View();
 }
コード例 #2
0
ファイル: Controller.php プロジェクト: slaveek/Huge-Namespace
 /**
  * Construct the (base) controller. This happens when a real controller is constructed, like in
  * the constructor of IndexController when it says: parent::__construct();
  */
 public function __construct()
 {
     // always initialize a session
     Session::init();
     // check session concurrency
     Auth::checkSessionConcurrency();
     // user is not logged in but has remember-me-cookie ? then try to login with cookie ("remember me" feature)
     if (!Session::userIsLoggedIn() && Request::cookie('remember_me')) {
         header('location: ' . Config::get('URL') . 'login/loginWithCookie');
     }
     // create a view object to be able to use it inside a controller, like $this->View->render();
     $this->View = new View();
 }