title: Can't check if a role is granted
body: <p>I've to set dynamic role to an user when he logs in, so I've created a service <code>LoginSuccessHanlder</code> with this function on login success :</p>
  
  <pre><code>public function onAuthenticationSuccess(Request $request, TokenInterface $token) {
      $response = null;
  
      $user = $this-&gt;token-&gt;getToken()-&gt;getUser();
      $poste = $request-&gt;get('_poste');
      $user-&gt;addRole('ROLE_'.strtoupper($poste));
      $this-&gt;em-&gt;persist($user);
      $this-&gt;em-&gt;flush();
      if ($this-&gt;authorizationChecker-&gt;isGranted('ROLE_USER')) {
          $response = new RedirectResponse($this-&gt;router-&gt;generate('homepage'));
          $response-&gt;headers-&gt;setCookie(new Cookie('poste', $poste));
      }
  
      return $response;
  }
  </code></pre>
  
  <p>So here, I add a new role to the user thanks to a field in the login form <code>_poste</code>
  . Once I'm logged in I should be able to do :</p>
  
  <pre><code>{% if is_granted("ROLE_FLEX") %}
      message
  {% endif %}
  </code></pre>
  
  <p>But there is no message</p>
  
  <p>But if I do this : </p>
  
  <pre><code>{{ dump(app.user.roles) }}
  </code></pre>
  
  <p>I have in the array the role <code>ROLE_FLEX</code>, why I can't check the role with <code>is_granted</code> function ? What did I missed ?</p>
  
  <p>For information, I'm using FOSUserBundle</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I remove the role each time that the user logout so when a user logout he doesn't have the <code>ROLE_FLEX</code> anymore but the role will be added if he check this role on log in. Basically the user has a role for each session</p>