src/components/AdminUser.php
public function onBeforeLogout()
    {
        UserOnline::removeUser($this->id);
        
        $this->identity->updateAttributes([
            'auth_token' => Yii::$app->security->hashData(Yii::$app->security->generateRandomString(), $this->identity->password_salt),
        ]);
        
        // kill all user logins for the given user
        UserLogin::updateAll(['is_destroyed' => true], ['user_id' => $this->id]);
    }
public function onBeforeLogout()
    {
        UserOnline::removeUser($this->id);
        
        $this->identity->updateAttributes([
            'auth_token' => Yii::$app->security->hashData(Yii::$app->security->generateRandomString(), $this->identity->password_salt),
        ]);
        
        // kill all user logins for the given user
        UserLogin::updateAll(['is_destroyed' => true], ['user_id' => $this->id]);
    }
public function onBeforeLogout ( ) { UserOnline :: removeUser ( $ this -> id ) ; $ this -> identity -> updateAttributes ( [ 'auth_token' => Yii :: $ app -> security -> hashData ( Yii :: $ app -> security -> generateRandomString ( ) , $ this -> identity -> password_salt ) , ] ) ; // kill all user logins for the given user UserLogin :: updateAll ( [ 'is_destroyed' => true ] , [ 'user_id' => $ this -> id ] ) ; }
After loging out, the useronline status must be refreshed and the current user must be deleted from the user online list.
After loging out the useronline status must be refreshed and the current user must be deleted from the user online list .