0

I tried many options in config.php file but no success. 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!

JadedCore
  • 1,993
  • 1
  • 13
  • 20

1 Answers1

0

use the following code in your (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
    ));
Ajay Krishna Dutta
  • 722
  • 2
  • 7
  • 21
  • I would recommend changing 'defaults' => 'cake' to 'defaults' => 'php' since the original question referred to using php for session. The rest should work though. :) – JadedCore Aug 03 '17 at 17:36