title: Symfony, force logout in a controller
body: <p>I'm using Symfony 3.4, and I would like to logout my user at the end of my action in my controller.</p>
  
  <p>This is the action</p>
  
  <pre><code>public function changeUserEmail() {
       /* change the user email */
       /* perform the logout */
       /* choose the route to redirect to */
       return $this-&gt;redirectToRoute(/* some route choosen above */);
  }
  </code></pre>
  
  <p>Is there a way to implement <code>/* perform the logout */</code> 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.</p>
  
  <p>Many thanks.</p>
  
  <p>Version or Symfony is 3.4</p>