How to let user keep logging in?

I want to let the user after login will keep log in until they sign out manually.

I’ve checked that ‘allowAutoLogin’ value has been set true. But still the user will log out after some time idle.

anybody know what else should I set? Thanks before

Setting the configuration of the user class to:


'allowAutoLogin'=>true,

Is only part of what you need to do. You still need to explicitly set a non zero value for the $duration parameter when making the call to login:


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

If this is not explicitly set, it will default to 0, which will result in no browser cookie being written.

Oo… So I just need to put any number in second parameter, right?

I’ll try it…

Thanks, Jefftulsa…