show news events to user after login

by using this code, i can show new events to user after each login:

public function actionLogout()


        $user = User::find()->where('id = :id', [':id' => \Yii::$app->user->identity->id])->one();




        return $this->goHome();


but it only works when user use the logout button before leave the website(not with auto login)

how can do the stuff with auto-login option?

thanks in advanced