Yii page timeout

Hi everyone, currently I had done few project by using Yii Framework. But 1 thing I’m curious is the timeout for it. Yii will auto logout the page if I put the page idle for sometime (for example, half an hour). How to avoid this or is there any way to set the timeout time?

Thanks.

In you models folder, you will find a file named LoginForm.php. There is a method named login in that model. You can set the timeout duration there when you login the user -


$duration = 3600*24*30; //30 days here

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

Thanks a lot Mukesh. I will try it now.

It seems the page will still auto logout.