title: Redirect Symfony2 LogoutSuccessHandler to original logout target
body: <p>I need to modify my user object on logout. To do this, I have a security.yml that contains the following (amongst other things) - </p>
  
  <pre><code>#...
      logout:
          success_handler: my.logout_success_handler
          target: /
  #...
  </code></pre>
  
  <p>...this defines a logout success handler, which is defined in services.yml like this - </p>
  
  <pre><code>   my.security.logout_success_handler:
         class: My\Security\LogoutSuccessHandler
         arguments: ["@security.context", "@doctrine.orm.default_entity_manager"]
  </code></pre>
  
  <p>...finally, the business-end of my handler is like this - </p>
  
  <pre><code>// ...
  public function onLogoutSuccess(Request $request)
  {
  
      $user = $this-&gt;securityContext-&gt;getToken()-&gt;getUser();
  
      // ... do stuff with the user object....
      $this-&gt;em-&gt;flush();
  
      // now what?
  
  }
  // ...
  </code></pre>
  
  <p>So, where it says "now what?" I understand that I need to return a Response object. Ideally I want that response object to redirect the user to whatever is defined in logout.target in the security.yml.</p>
  
  <p>Is there an easy way I can query that? Or, even better, is there another way of doing this kind of thing that doesn't require me to get involved with the request/response objects at all?</p>
  
  <p>Thanks</p>