I’ve been trying to change the length of time before the system logs out a user. I’ve tried the following in /protected/config/main.php:
'components'=>array(
'user'=>array(
// enable cookie-based authentication
'class'=>'application.components.WebUser',
'allowAutoLogin'=>true,
),
'session'=>array(
'timeout'=>1,
),
of course changing timeout to various values, but even at 1 it doesn’t log the user out in 1 second. I’ve also tried changing the login method in /protected/models/LoginForm.php:
public function login()
{
if($this->_identity===null)
{
$this->_identity=new UserIdentity($this->username,$this->password);
$this->_identity->authenticate();
}
if($this->_identity->errorCode===UserIdentity::ERROR_NONE)
{
$duration=$this->rememberMe ? 3600*24*30 : 0; // 30 days
Yii::app()->user->login($this->_identity,$duration);
return true;
}
else
return false;
}
I’ve tried making $duration larger, smaller, and taking that argument out and it doesn’t change anything. My users are still being logged out in about an hour or so. Any help is appreciated - I just want the users to be able to stay logged in for 8-12 hours so that they don’t walk away from their computer, come back, refresh the page and have to log in again. Thanks!