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

[BUG]: session prefix fail "sess_" (phalcon 4.0.4)

phalcon 4.0.4

проблема: Сессии создаются без префикса "sess_"

последствия:

код используемый для работы с сессиями (взят от сюда https://docs.phalcon.io/4.0/en/session)

$dependencyInjector->set('session', function () {
            $session = new \Phalcon\Session\Manager(array(
                'uniqueId' => 'session-',
            ));
            $files = new \Phalcon\Session\Adapter\Stream(['savePath' => session_save_path(),]);
            $session->setAdapter($files);

            if ($session->exists() == FALSE) {
                $session->start();
            }
            return $session;
        }, TRUE);


318
Accepted
answer

сам себе ответил

$dependencyInjector->set('session', function () {
            $session = new \Phalcon\Session\Manager(array(
                'uniqueId' => 'session-',
            ));
            $files = new \Phalcon\Session\Adapter\Stream([
                'savePath' => session_save_path(),
                'prefix'   => 'sess_',
            ]);
            $session->setAdapter($files);

            if ($session->exists() == FALSE) {
                $session->start();
            }
            return $session;
        }, TRUE);
edited Mar '20

OK got it.