$app->user->isGuest always true when uploaded on server...

I have this weird issue where Yii::$app->user->isGuest is always true on my server but when running locally via Xampp it works perfectly after logging in…Here is the code i question after user has logged in…


public function actionViewer()


        if (Yii::$app->user->isGuest) {

            return $this->goHome(); 

        } else {

            return $this->render('viewer');



I have no idea what the problem could be…It used to work perfectly when on the server but not anymore…I have tried re-uploading multiple times to no avail