common/controllers/SiteController.php
public function actionLogout() {

		// Logout User
		Yii::$app->user->logout();

		// Destroy Session
		Yii::$app->session->destroy();

		// Redirect User to appropriate page
		return $this->redirect( [ Yii::$app->core->getLogoutRedirectPage() ] );
	}
public function actionLogout() {

		// Logout User
		Yii::$app->user->logout();

		// Destroy Session
		Yii::$app->session->destroy();

		// Redirect User to appropriate page
		return $this->redirect( [ Yii::$app->core->getLogoutRedirectPage() ] );
	}
public function actionLogout ( ) { // Logout User Yii :: $ app -> user -> logout ( ) ; // Destroy Session Yii :: $ app -> session -> destroy ( ) ; // Redirect User to appropriate page return $ this -> redirect ( [ Yii :: $ app -> core -> getLogoutRedirectPage ( ) ] ) ; }
The method clears user session and cookies and redirect user to login.
The method clears user session and cookies and redirect user to login .