dongyixiu3110 2016-07-27 21:10
浏览 43
已采纳

会话超时在Cakephp 2中不起作用

I need to define a very large session time on a cakephp 2 application due to a business need. I defined it on the core.php file as follows:

Configure::write('Session', array(
   'defaults'  => 'php', //defaults => php
   'cookie' => 'cookie',
   'timeout'   => 4320 // 3 days
));

I made a test and arround two hours of inactivity my session is closed, every time I click a button I get back to the logon screen, how can I effectively control my session time?

  • 写回答

1条回答 默认 最新

  • doudizhi947129 2016-07-28 04:43
    关注

    Use this It may work.it is working for me

    core.php

     Configure::write('Session', array(
                'defaults' => 'php',
                'timeout' => 259200,
                'ini' => array(
                    'session.gc_maxlifetime' => 259200 // 3 day
                )
        ));
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?