Login not persisted


i’m trying to implement an external login (based on central authentication service) in a yii2.0 basic application.

In the siteController i set the connexion information by:


                Yii::$app->user->login($model->getUser(), 0);

                return $this->goHome();

Value is ok (tested with var_dump).

But when i go back to main menu i am still considered as guest (Yii::$app->user->identity is NULL).

In my web.php configuration:


        'user' => [

            'identityClass' => 'app\models\ReprUser',

            'enableAutoLogin' => false,

            'enableSession' => true,



I’ve check my custom user class implements IdentityInterface.

Thanks in advance for your help.

No one got this kind of problem?