I would like to know the instruction how to remove a user that has just been authenticated so it would be like no user has been authenticated.
Should I delete the content of the session or is there a proper way ?
I would like to know the instruction how to remove a user that has just been authenticated so it would be like no user has been authenticated.
Should I delete the content of the session or is there a proper way ?
you can try this :
$this->get('security.token_storage')->setToken(null);
$this->get('request')->getSession()->invalidate();