title: How to log out a banned user in Symfony?
body: <p>Symfony provides a simple way of preventing users from logging in using the <code>isEnabled</code> property if the user class implements <code>AdvancedUserInterface</code>.</p>
  
  <p>However, if the user is logged in nothing will prevent them from accessing the website until their session expires.</p>
  
  <p>The idea would be to check the <code>isEnabled</code> property upon getting the user entity (<code>$this-&gt;get('security.token_storage')-&gt;getToken()-&gt;getUser()</code>) and to invalidate the session then. What is the preferred way of doing so?</p>
  
  <p>Or is there a better way to achieve this goal?</p>