简体   繁体   English

会话在cakePHP 2.9中很快终止

[英]Session expires very quickly in cakePHP 2.9

I tried many options in config.php file but no success. 我在config.php文件中尝试了许多选项,但没有成功。 Here the options. 这里的选项。 first one: 第一:

 Configure::write('Session', array(
    'defaults' => 'php',
            'timeout' => 31556926, // The session will timeout after 30 minutes of inactivity
            'cookieTimeout' => 31556926,
            'ini' => array(
               'session.gc_maxlifetime' => 31556926 // 36 hours
             )
));

second one: 第二个:

 Configure::write('Session', array(
    'defaults' => 'php',
    'Session.timeout' => 36000
 ));

Please let me know, as session expires in middle of work! 请让我知道,因为会话将在工作中终止!

use the following code in your (app/Config/core.php) 在(app / Config / core.php)中使用以下代码

 Configure::write('Session', array(
        'defaults' => 'cake',
        'timeout' => 30, // The session will timeout after 30 minutes of inactivity
        'cookieTimeout' => 1440, // The session cookie will live for at most 24 hours, this does not effect session timeouts
        'checkAgent' => false,
        'autoRegenerate' => true, // causes the session expiration time to reset on each page load
    ));

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM