title: symfony2 logout
body: <p>My problem is capture user logout. the code what i have is:</p>
  
  <pre><code>public  function onAuthenticationFailure(Request $request, AuthenticationException $exception){
  
      return new Response($this-&gt;translator-&gt;trans($exception-&gt;getMessage()));
  }
  
  public function logout(Request $request, Response $response, TokenInterface $token)
  {
      $empleado = $token-&gt;getUser();
      $log = new Log();
      $log-&gt;setFechalog(new \DateTime('now'));
      $log-&gt;setTipo("Out");
      $log-&gt;setEntidad("");
      $log-&gt;setEmpleado($empleado);
      $this-&gt;em-&gt;persist($log);
      $this-&gt;em-&gt;flush();
  }
  
  public function onLogoutSuccess(Request $request) {
      return new RedirectResponse($this-&gt;router-&gt;generate('login'));
  }
  </code></pre>
  
  <p>The problem is I can not access the user token <code>TokenInterface</code> when you are running the logout function?</p>