1

I have Yii application and inside there is a module 'admin', which requires auth. And so it has model 'LoginForm' - generated by yii, where there is a line:

$duration=$this->rememberMe ? 3600*24*30 : 0;

So, if i check 'remember me' checkbox the session should live for 30 days, but it actually lives for about 90 minutes (approx.) anyway. Can anyone please help me to solve this?

Max Filippov
  • 2,024
  • 18
  • 37
  • Did you check if the cookie is stored in your browser? – Tim Apr 08 '13 at 17:00
  • Yes, [here it is](https://dl.dropbox.com/u/17309724/cookie.png) – Max Filippov Apr 08 '13 at 17:10
  • Probably duplicated: [Yii users being logged out after 15-30 minutes...](http://stackoverflow.com/questions/12859333/yii-users-being-logged-out-after-15-30-minutes-despite-session-timeouts-being-se) – Eduardo M Apr 09 '13 at 07:05
  • I have this code after:Yii::app()->user->login($this->_identity,$duration); – Max Filippov Apr 09 '13 at 07:37
  • 1
    What is the value of `session.gc_maxlifetime`? It needs to be at least as large as the session duration. – Jon Apr 09 '13 at 09:41
  • Where can I check this? – Max Filippov Apr 09 '13 at 20:50
  • Look at `php.ini` for `gc_maxlifetime` and make sure that `authTimeout` of `CWebUser` has been also set properly in `config/main.php`: http://www.yiiframework.com/doc/api/1.1/CWebUser#authTimeout-detail – ezze Apr 09 '13 at 21:18
  • `authTimeout` of `CWebUser` I set to 3600*24*30. php.ini: `session.use_only_cookies = 1` `session.cookie_lifetime = 0` `session.gc_maxlifetime = 1440` Shold I set session.gc_maxlifetime to 3600*24*30? – Max Filippov Apr 10 '13 at 08:54

0 Answers0