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 deleting with variable is not working

If I use assign string for session delete , it is deleted ..

$this->session->remove('auth');

But If i use php variable for that , it is not deleted ! Help me because I have a lot of session name so need to loop and delete with variable ?? :(

 $del_name = "auth";
 $this->session->remove($del_name); // not delete 
$session_name = 'other_session';
$this->session->remove($session_name);

but you need to register sessions with other names ex:

$this->session->set('other_session', array(
         'id' => $user->id,
         'username' => $user->username,
         'avatar' => $user->avatar
));