Home > PHP Framework > YII > body text

How to log out of yii

Release: 2019-12-31 15:07:45
Original
2549 people have browsed it

How to log out of yii

yii user exit operation

public function actionLogout()
{
    Yii::$app->user->logout();
    return $this->goHome();
}
Copy after login

Judge whether the user is logged in

public function actionLogin()
{
    if (!\Yii::$app->user->isGuest) {
        return $this->goHome();
    }
}
Copy after login

Recommended learning: yii framework

The above is the detailed content of How to log out of yii. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
yii
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template