CakePHP 3 losing Auth Session

谁说胖子不能爱 提交于 2019-12-24 03:11:16

问题


I am using Auth Session in CakePHP.

'Session' => [
    'timeout' => 0,
    'defaults' => 'php',
    'ini' => [
        'session.cookie_secure' => false,
        'session.cookie_lifetime' => 0
    ]
],

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.


回答1:


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.
        )
    );


来源:https://stackoverflow.com/questions/31539445/cakephp-3-losing-auth-session

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!