I'm using Symfony 3.4, and I would like to logout my user at the end of my action in my controller.
This is the action
public function changeUserEmail() {
/* change the user email */
/* perform the logout */
/* choose the route to redirect to */
return $this->redirectToRoute(/* some route choosen above */);
}
Is there a way to implement /* perform the logout */
the Symfony way? I found nothing in the docs.
I do want to logout in the controller (don't want to redirect to the logout path) and I want to choose the route to be redirected in the controller.
Many thanks.
Version or Symfony is 3.4