I want one user to fail to log in from two or more browsers, devices, and so on. If the user is already online, then there was an error.

    2 answers 2

    <?php if($user->isOnline()) { echo 'user is online'; } ?> 

      In Yii2, write correctly

       Yii::$app->user->getIsGuest(); // возвращает тип bool 

      or

       Yii::$app->user->isGuest; // возвращает тип bool 
      • Why is it “right” and how does the guest flag relate to the subject of the question - Kromster