My login sessions never time out.

I've tried a few things. I expected the following to work.

    $di->set('session', function() {
        $session = new \Phalcon\Session\Adapter\Files(['lifetime' => 10, 'cookie_lifetime' => 10]);
        $session->start();
        return $session;
    }, true);

But alas and woe it doesn't. The documentation on setting options doesn't seem to have been written yet (confused) so I had to make a guess from code in the incubator repo. But that doesn't work. I have tried $session->setOptions also.

I think I was expecting file() to have such a feature but it doesn't seem to.



17.4k

Have you tried this?

$di->set('session', function() {
        $session = new \Phalcon\Session\Adapter\Files(['lifetime' => 10, 'cookie_lifetime' => 10]);

        session_set_cookie_params(10); //here

        $session->start();
        return $session;
    }, true);

Nope, not making any difference.