title: Redirect if the user is logged in
body: <p>I am building a web application with Symfony 2, using the FOSUserBundle bundle.<br>
  Users create an account, login and start using the application.  </p>
  
  <p>What I want to achieve now is to have the user redirected to their account from any page they may be at if they are logged in.<br>
  This includes:</p>
  
  <ul>
  <li>if they get back to the login page</li>
  <li>if they get back to the registration page</li>
  <li>if they go to the homepage of the website</li>
  <li>once they confirm their email</li>
  <li>once they reset their password</li>
  </ul>
  
  <p>Basically the code would be something like this:</p>
  
  <pre><code>$container = $this-&gt;container;
  $accountRouteName = "DanyukiWebappBundle_account";
  if( $container-&gt;get('security.context')-&gt;isGranted('IS_AUTHENTICATED_FULLY') ){
      // authenticated (NON anonymous)
      $routeName = $container-&gt;get('request')-&gt;get('_route');
      if ($routeName != $accountRouteName) {
          return $this-&gt;redirect($this-&gt;generateUrl($accountRouteName));
      }
  }
  </code></pre>
  
  <p>The problem is I don't know where that code should go.<br>
  It should be executed for any request. In Symfony 1 I would have used a filter.</p>