CakePHP 3丢失Auth会话
问题描述:
我正在CakePHP中使用Auth Session.
I am using Auth Session in CakePHP.
'Session' => [
'timeout' => 0,
'defaults' => 'php',
'ini' => [
'session.cookie_secure' => false,
'session.cookie_lifetime' => 0
]
],
已经在app.php中配置了此功能,但几分钟后仍然注销.
Already configured this in tha app.php but still getting logged out after few minutes.
尽管在关闭浏览器时会话仍然存在.所以我认为这只是一个与时间有关的问题.
Although Session persists when closing Browser. So i think its just a time related problem.
答
我要求增加cakphp 2.5中的会话超时 以下代码在2.5中对我有用,您可以尝试一下
I was having requirement to increase session timeout in cakphp 2.5 the following code worked for me in 2.5 you can give this a try
//FILE: config/core.php
Configure::write('Session', array(
'defaults' => 'cake',
'cookie' => 'my_app',
'timeout' => 500, // 8 hours + 20 min, user will be logged in till 8 hours.
)
);