src/controllers/DefaultController.php
public function actionLogout()
    {
        if (!Yii::$app->adminuser->logout(false)) {
            Yii::$app->session->destroy();
        }
        
        return $this->redirect(['/admin/login/index', 'logout' => true]);
    }
public function actionLogout()
    {
        if (!Yii::$app->adminuser->logout(false)) {
            Yii::$app->session->destroy();
        }
        
        return $this->redirect(['/admin/login/index', 'logout' => true]);
    }
public function actionLogout ( ) { if ( ! Yii :: $ app -> adminuser -> logout ( false ) ) { Yii :: $ app -> session -> destroy ( ) ; } return $ this -> redirect ( [ '/admin/login/index' , 'logout' => true ] ) ; }
Trigger user logout.

@return \yii\web\Response
Trigger user logout .