yii2 设置session过期时间

Problem is in cookies expire time. When it timed out, user is logout. Solution, for changing cookies expire time is in configuration for session component set for cookies lifetime:

‘components’ => [
‘session’ => [
‘class’ => ‘yii\web\Session’,
‘cookieParams’ => [‘lifetime’ => 7 * 24 *60 * 60]
],
]
When user login, cookies expire time in current example is after week.
设置session过期时间不起作用,无效。解决办法:
问题在于cookie的过期时间,设置cookie的生命周期时间lifttime就可以了。