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 not destroy with redis

This is an example:

    $di->setShared('session', function() {
    $session = new Phalcon\Session\Adapter\Redis(array(
        'path' => "tcp://127.0.0.1:6379?weight=1",
        'name' => SITE_DOMAIN . '-'
    ));

    $session->start();

    return $session;
});

on Controller..

$this->session->set(self::BTS_SESSION_USER_ID, 1); 
$this->session->set(self::BTS_SESSION_USER_NAME, 'hugo');

But when i do:

$this->session->destroy();

The session persist! and not clean!



98.9k

Destroy the session does not remove data from the $_SESSION superglobal

Yes!, you are right!.. i solved this problem with:

    session_unset();
    session_regenerate_id(true);

this works!, the reason that i want to destroy all session data, not only one key, for example for logout

there is any way to do that? with : $this->session-> ?

edited Feb '16

Destroy the session does not remove data from the $_SESSION superglobal

Care to explain why that is or how you're suposed to work with sessions in phalcon? I find this functionallity very different from other php-frameworks ...

(sorry for the necro-post)