We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

session data lifecycle

My website (phalcon 1.3.3 based) uses session to store user login data. It seems that the login data is invalid after about 3 or 4 hours. User had logined in the system had to re-login the system again after a period of time.

How to set the session lifecycle?

Thanks!

current configuration about session

...
$di->setShared('session', function() {
    $session = new Phalcon\Session\Adapter\Files();
    $session->start();
    return $session;
});
...


51.1k
$di->setShared('session', function() {
    $session = new Phalcon\Session\Adapter\Files([
        'lifetime' => 3600 * 24 
    ]);
    $session->start();
    return $session;
});