如何增加cakephp 2的登录时间 [英] How to increase the login time for cakephp 2

查看:62
本文介绍了如何增加cakephp 2的登录时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您能告诉我如何增加CakePHP 2的会话到期时间吗?

Can you please let me know how to increase the session expiry time for CakePHP 2?

当前,我将配置设置为以下。

Currently, i set the configuration as bellow.

Configure::write('Session', array(
        'defaults' => 'php',
                'timeout' => 129600, // The session will timeout after 30 minutes of inactivity
                'cookieTimeout' => 129600, // The session cookie will live for at most 24 hours, this does not effect session timeouts
                'ini' => array(
                   'session.gc_maxlifetime' => 129600 // 36 hours
                 )
    ));

但是,这些设置不起作用,会话在将近24分钟后过期。感谢
此线程未能解决我的问题 如何增加cakephp Auth组件会话过期时间

But, these settings not work and session expired in almost 24 minutes.Thanks This thread didn't solve my problem "How to increase cakephp Auth component session expire time"

推荐答案

将此配置添加到应用程序的core.php文件中

Add this configuration in core.php file of your application

Configure::write('Session', array(
'defaults' => 'cache',//default session
'timeout'  => '<time_in_minute>',//in minutes
'cookieTimeout' => '<time_in_minute>',//in minutes
'ini' => array('session.cookie_domain' => env('HTTP_BASE')),
'handler' => array(
    'config' => '<handler>' //if you are using default sessions then this field is not necessary
 )
));

根据您的要求添加时间

这篇关于如何增加cakephp 2的登录时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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