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

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.



10.9k

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



26.3k

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


10.9k

Nope, not making any difference.