BWSnippet

Yii - User check if logged in

Yii - User check if logged in

Check if a user is logged in using Yii-User within Yii

Simply

    !Yii::app()->user->isGuest

Or

To check if they are not logged in

    Yii::app()->user->isGuest

isGuest is just any non-logged in viewer.

Tags

Yii - User check if logged in