title: Symfony 2.1 security login check error
body: <p>I am building the login form as shown in symfony 2.1 documentation.  i am doing the same thing.
  i got success in simple authorization but when i create the simple login form i gets   login_check route not found.
    if i put login_check route then i got login_check error.<br>
  Documentation says nothing about this. 
  My security.yml is </p>
  
  <pre><code># app/config/security.yml
  security:
    providers:
      in_memory:
          memory:
              users:
                  ryan:  { password: ryanpass, roles: 'ROLE_USER' }
                  admin: { password: kitten, roles: 'ROLE_ADMIN' }
  
  firewalls:
      login:
          pattern:  ^/login$
          security: false
      secured_area:
          pattern:    ^/admin
          anonymous: false
          form_login:
              login_path: /login
              check_path: /login_check
              always_use_default_target_path: false
              default_target_path:            /admin/content/index
              target_path_parameter:          _target_path
              use_referer:                    false
              username_parameter:             _username
              password_parameter:             _password
              csrf_parameter:                 login[_token]
          logout: 
              path: /admin/logout
              target: /login
  access_control:
      - { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }
      - { path: ^/admin, roles: ROLE_ADMIN }
  
  encoders:
      Symfony\Component\Security\Core\User\User: plaintext
  </code></pre>
  
  <p>and routing.yml is </p>
  
  <pre><code>login:
  pattern:  /login
  defaults: { _controller: AcmeTaskBundle:Default:login}
  
  login_check:
  pattern: /login_check        
  defaults: { _controller: AcmeTaskBundle:Default:loginCheck}
  
  logout:
  pattern: /admin/logout
  defaults: { _controller: AcmeTaskBundle:Default:logout}
  content_index:
  pattern: /admin/content/index
  defaults: { _controller: AcmeTaskBundle:Default:index }
  </code></pre>
  
  <p>my controller login action is </p>
  
  <pre><code>namespace Acme\TaskBundle\Controller;
  use Symfony\Bundle\FrameworkBundle\Controller\Controller;
  use Symfony\Component\HttpFoundation\Request;
  use Acme\TaskBundle\Entity\Product;
  use Acme\TaskBundle\Entity\CmsContentMst;
  use Acme\TaskBundle\Entity\CmsSectionsMst;
  
  // use Acme\TaskBundle\Entity\ProductType;
  use Symfony\Component\HttpFoundation\Response;
  use Acme\TaskBundle\Form\Type\AddContent;
  use Symfony\Component\Security\Core\SecurityContext;
  
  class DefaultController extends Controller
  {   
  public function loginAction()
  {
      $request = $this-&gt;getRequest();
      $session = $request-&gt;getSession();
  
      // get the login error if there is one
      if ($request-&gt;attributes-&gt;has(SecurityContext::AUTHENTICATION_ERROR)) {
          $error = $request-&gt;attributes-&gt;get(
              SecurityContext::AUTHENTICATION_ERROR
          );
      } else {
          $error = $session-&gt;get(SecurityContext::AUTHENTICATION_ERROR);
          $session-&gt;remove(SecurityContext::AUTHENTICATION_ERROR);
      }
  
      return $this-&gt;render(
          'AcmeTaskBundle:Default:login.html.twig',
          array(
              // last username entered by the user
              'last_username' =&gt; $session-&gt;get(SecurityContext::LAST_USERNAME),
              'error'         =&gt; $error,
          )
      );
    }
  public function panelAction(Request $request)
  {   
  
  }
  public function loginCheckAction()
    { 
  
      return new Response('true');
  
    }
  </code></pre>
  
  <p>and login.html.twig is </p>
  
  <pre><code>{# src/Acme/SecurityBundle/Resources/views/Security/login.html.twig #}
  {% if error %}
    &lt;div&gt;{{ error.message }}&lt;/div&gt;
  {% endif %}
  
   &lt;form action="{{ path('login_check') }}" method="post"&gt;
  &lt;label for="username"&gt;Username:&lt;/label&gt;
  &lt;input type="text" id="username" name="_username" value="{{ last_username }}" /&gt;
  
  &lt;label for="password"&gt;Password:&lt;/label&gt;
  &lt;input type="password" id="password" name="_password" /&gt;
  
  {#
      If you want to control the URL the user is redirected to on success (more details      below)
      &lt;input type="hidden" name="_target_path" value="/account" /&gt;
     #}
  
   &lt;button type="submit"&gt;login&lt;/button&gt;
   &lt;/form&gt;
  </code></pre>
  
  <p>What should i put in login check.controller...if someone have complete login example in   symfony 2.1 plz put it in answer..   </p>