I am saving the current user s data in a session, I am using Symfony 4.4 I am getting and setting the data to the session variable this way
$session = $this->get('session');
$session->set('user', $user);
is there any way to clear and delete the session after logging out I tried
$session->invalidate();
and deleting the session one by using remove and nothing happened
$session->remove('user');
CodePudding user response:
i randomly came across this and it works just fine
$this->get('session')->clear();