Ali.B
Ali.B

Reputation: 307

CakePHP - Increasing session time

I need to increase the session time for logged in users on my project. This is the session info in core.php:

Configure::write('Session', array(
    'defaults' => 'php',
    'cookieTimeout' => 1440,
    'autoRegenerate' => true,
    'cookie' => 'SYNAPARTY'
));

This generates a cookie that expires in 24 hours. The problem is the user gets logged out after sometime of inactivity. How can I solve this?

Upvotes: 0

Views: 94

Answers (1)

IWillScoop
IWillScoop

Reputation: 258

Try changing it to:

Configure::write('Session', array(
    'defaults' => 'php',
    'cookieTimeout' => 1440,
    'timeout' => 1440 //Or whatever amount of minutes you want
    'autoRegenerate' => true,
    'cookie' => 'SYNAPARTY'
));

Upvotes: 1

Related Questions