$This->Getstate Not Working

hi every body

i make a rapid test to authentication system

in cuseridentity file


    public function authenticate()

    {

        $this->setState('mo', 'xcvcx');


        return true;

    }



in login controller


    public function actionLogin()

    {

        $identity = new CUserIdentity('1234', 'yyuu');

        Yii::app()->user->login($identity);

    }



in index action


    public function actionIndex()

    {

        if (!yii::app()->user->isGuest) {


            echo yii::app()->user->mo;

        }




        $this->render('index');

    }



but a problem ocuurs that mo is not defined so what is the error i done?

hay gays i solve it

i forgot to call


$identity->authenticate();

that’s it an it’s working now