isConcurrentSessionExists() public static method

This is done as the following: UserA logs in with his session id('123') and it will be stored in the database. Then, UserB logs in also using the same email and password of UserA from another PC, and also store the session id('456') in the database Now, Whenever UserA performs any action, You then check the session_id() against the last one stored in the database('456'), If they don't match then log both of them out.
See also: Session::updateSessionId()
See also: http://stackoverflow.com/questions/6126285/php-stop-concurrent-user-logins
public static isConcurrentSessionExists ( ) : boolean
return boolean
コード例 #1
0
ファイル: Auth.php プロジェクト: panique/huge
 /**
  * Detects if there is concurrent session (i.e. another user logged in with the same current user credentials),
  * If so, then logout.
  */
 public static function checkSessionConcurrency()
 {
     if (Session::userIsLoggedIn()) {
         if (Session::isConcurrentSessionExists()) {
             LoginModel::logout();
             Redirect::home();
             exit;
         }
     }
 }
コード例 #2
0
ファイル: Auth.php プロジェクト: slaveek/Huge-Namespace
 /**
  * Detects if there is concurrent session (i.e. another user logged in with the same current user credentials),
  * If so, then logout.
  */
 public static function checkSessionConcurrency()
 {
     if (Session::userIsLoggedIn()) {
         if (Session::isConcurrentSessionExists()) {
             \Huge\Model\LoginModel::logout();
             Redirect::home();
             Application::stop();
         }
     }
 }
コード例 #3
0
ファイル: AuthComponent.php プロジェクト: reallysend/miniPHP
 private function concurentSession()
 {
     return Session::isConcurrentSessionExists();
 }