title: Symfony2 - detect if user is inside a secure firewall
body: <p>I'm trying to find out if a user is inside a secure firewall.</p>
  
  <p>security.yml:</p>
  
  <pre><code>firewalls:
      non_secure_area:
          pattern: ^/
          anonymous: true
      secure_area:
          pattern: ^/admin
          form_login:
              #etc.
          logout:
              #etc.
  </code></pre>
  
  <p>So I need to know if the user is inside the 'secure_area' secure part of the site.</p>
  
  <p>I have used this, but of course it only tells me if somebody is 'logged in' AND on a HTTPS page. There must be a better way:</p>
  
  <pre><code>if( $request-&gt;isSecure() &amp;&amp; $securityContext-&gt;isGranted('IS_AUTHENTICATED_REMEMBERED') ) {
  
  } 
  </code></pre>