Auth::checkSessionConcurrency PHP Method

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 ( )
    public static function checkSessionConcurrency()
    {
        if (Session::userIsLoggedIn()) {
            if (Session::isConcurrentSessionExists()) {
                LoginModel::logout();
                Redirect::home();
                exit;
            }
        }
    }

Usage Example

 function __construct()
 {
     Session::init();
     Auth::checkSessionConcurrency();
     if (!Session::userIsLoggedIn() && Request::cookie('remember_me')) {
         Redirect::to("login/loginWithCookie");
     }
     $this->view = new View();
 }
All Usage Examples Of Auth::checkSessionConcurrency