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;
});
...


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