CakePHP 3丢失Auth会话 [英] CakePHP 3 losing Auth Session

查看:69
本文介绍了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.
        )
    );

这篇关于CakePHP 3丢失Auth会话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆