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 path

I wondered that Phalcon\Session\Adapter\Files haven't any methods to set custom directory for saving session files. If we have multiple installations of the same app on the same server, prefixes isn't helpful. I think that ability to specify working directory is must-have feature for file-based session handler.

edited Jul '15

You can set the session.save_path before start the session:


$di->set('session', function() {
    session_save_path('/my/awesome/path');

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


12.3k
Accepted
answer

Of course. Just wondering because session.save_path is the configuration option for any file-based session save handler, but it's not wrapped with any framework entities.