We are moving our forum in GitHub Discussions. For questions about Phalcon v3/v4 you can visit here and for Phalcon v5 here.

session deleting with variable is not working

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


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';

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