frontend/controllers/UserController.php
/**
     * Logs out the current user.
     * @return mixed
     */
Logs out the current user.
@return mixed
Logs out the current user . @return mixed
public function actionLogout()
    {
        $user_id = $this->User->user_id;
        if ($user_id) {
            $session = new Sessions();
            $session->user_id = $user_id;
            $session->sess_action = Sessions::ACTION_LOGOUT;
            $session->save();
        }
        Yii::$app->user->logout();
        return $this->redirect('/entrance');
    }
public function actionLogout ( ) { $ user_id = $ this -> User -> user_id ; if ( $ user_id ) { $ session = new Sessions ( ) ; $ session -> user_id = $ user_id ; $ session -> sess_action = Sessions :: ACTION_LOGOUT ; $ session -> save ( ) ; } Yii :: $ app -> user -> logout ( ) ; return $ this -> redirect ( '/entrance' ) ; }
Logs out the current user.
Logs out the current user .