title: How to make custom voter call on every request in symfony2
body: <p>I read this question:<a href="https://stackoverflow.com/questions/17661249/symfony2-access-control-with-routes">Symfony2 access control with routes</a><br>
   so
  I've created a custom voter according to the instructions at <a href="http://symfony.com/doc/current/cookbook/security/voters.html" rel="nofollow noreferrer">http://symfony.com/doc/current/cookbook/security/voters.html</a> . 
  this is my service definition for the voter  </p>
  
  <pre><code>xml_menu:
      class: "%xml_menu.v1.class%"
      arguments: [""]
  
  route_voter:
      class: "%route_voter.class%"
      arguments: [@request_stack, @xml_menu ]
      public: false
      tags:
          - { name: security.voter }    
  </code></pre>
  
  <p>and this is my firewall configuration for it:  </p>
  
  <pre><code>    test_secured_area:
          pattern: ^/test/
          form_login:
              check_path: _demo_security_check
              login_path: _demo_login
          logout:
              path:   _demo_logout
              target: _demo
  
  access_control:
  </code></pre>
  
  <p>I am intentionally using the demo login paths and left the access_control empty.
  I've manually tested the 'route_voter' service and know that it works.However it's load method is not called automatically on any request.is this behaviour supposed to be and I have to call the <code>isGranted()</code> method of the security context every time for example at the beginning of my controllers or am I doing something wrong?<br>
  If this is the way it's supposed to work how can I force the voter to be called on every request.</p>
  
  <p>what I'm trying to achive here is behaviour similar to access_control, if the user has permission to access the route, the voter returns <code>VoterInterface::ACCESS_GRANTED</code>, else, it returns <code>VoterInterface::ACCESS_DENIED</code>.and I want access control restrictions to be based on that.<br>
  what currently happens is I get redirected to the login page every time I try to access /test/foo, and when I login I'm redirected to hostname/ . then everytime I try to access /test/foo I'm redirected to the demo login page.however when I access the demo secured area it shows that I'm authenticated.so do I have to activate something for the /test/* paths for symfony to read the session and authenticate me so I'm not redirected back to the login page?</p>