Session data retrieving last query made

Hello, while initiating a new session in a login, the correct session data is only being applied to it once and afterwards it takes data of the last sql query made anywhere in the application, the same goes when trying to make any query, only the last query is being made, when removing the session, the correct query is being made. The session is only initiated once in the application in the login page.


$this->session->set("user", $user);


$di->set('session', function () {
    $session = new SessionAdapter();
    $session = new Phalcon\Session\Adapter\Files(
            'uniqueId' => 'client-backend'
    if (session_status() == PHP_SESSION_NONE) {
    return $session;


Try registering the service as shared:

$di->set('session', function () { /* ... */ }, true);

Have tried it before, doesn't seem to work :/