Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

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


166
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 6d ago

OK got it.