how Yii guest is working

Hi all,

How to set this value,Yii::app()->user->isGuest,i checked by the condition

if(!Yii::app()->user->isGuest) but the result is not working correclty.

Please help me.

isGuest is set by the framework when the user is not logged in, once you login value of isGuest is false

how this works underneath it uses the identity object to check if the identity is null that determines if the user is guest or loggedin, I would say if you wanna override the behavior you need to use setIdentity method for that, keep in mind setIdentity only take in IndentityInterface