src/controllers/LoginController.php
private function sessionBruteForceLock()
    {
        $attempt = Yii::$app->session->get('__attempt_count', 0);
        
        $counter = $attempt + 1;
        
        Yii::$app->session->set('__attempt_count', $counter);
        
        $lockout = Yii::$app->session->get('__attempt_lockout');
        
        if ($lockout && $lockout > time()) {
            Yii::$app->session->set('__attempt_count', 0);
            return $lockout;
        }
        
        if ($counter >= $this->module->loginSessionAttemptCount) {
            Yii::$app->session->set('__attempt_lockout', time() + $this->module->loginSessionAttemptLockoutTime);
        }
        
        return false;
    }
private function sessionBruteForceLock()
    {
        $attempt = Yii::$app->session->get('__attempt_count', 0);
        
        $counter = $attempt + 1;
        
        Yii::$app->session->set('__attempt_count', $counter);
        
        $lockout = Yii::$app->session->get('__attempt_lockout');
        
        if ($lockout && $lockout > time()) {
            Yii::$app->session->set('__attempt_count', 0);
            return $lockout;
        }
        
        if ($counter >= $this->module->loginSessionAttemptCount) {
            Yii::$app->session->set('__attempt_lockout', time() + $this->module->loginSessionAttemptLockoutTime);
        }
        
        return false;
    }
private function sessionBruteForceLock ( ) { $ attempt = Yii :: $ app -> session -> get ( '__attempt_count' , 0 ) ; $ counter = $ attempt + 1 ; Yii :: $ app -> session -> set ( '__attempt_count' , $ counter ) ; $ lockout = Yii :: $ app -> session -> get ( '__attempt_lockout' ) ; if ( $ lockout && $ lockout > time ( ) ) { Yii :: $ app -> session -> set ( '__attempt_count' , 0 ) ; return $ lockout ; } if ( $ counter >= $ this -> module -> loginSessionAttemptCount ) { Yii :: $ app -> session -> set ( '__attempt_lockout' , time ( ) + $ this -> module -> loginSessionAttemptLockoutTime ) ; } return false ; }
Ensure current brute force attempt based on session.

@return boolean|integer
@since 1.2.0
Ensure current brute force attempt based on session .