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

Just wondering...

Why I need to start a session before I set up some options? It wouldn't be more logical to do it before I start the session? (I'm wondering, I'm sure there will be very good reasons).


    $ID->setShared('session', function() {
        $session = new Files();
        $session->start();
        $session->set('auth', array(
                'id' => -1,
                'nombre' => 'anonimo',
                'rol' => 'Anonimo'
            ));
        return $session;
    });


125.8k
Accepted
answer

You're not setting options there - you're setting actual session values.