Q:

Symfony2 security.yml correct configuration

Im new to symfony2 version 3.0 and Im trying to create a login form. But I'm stuck in security.yml configuration and I dont know whats going on. Im been searching in google for 3 hours but no luck. Hope you can help me. So far here is my code.
security:
  encoders:
    AppBundle\Entity\User:
      algorithm: bcrypt

  providers:
    db_provider:
      entity:
        class: AppBundle:User
        property: username

  firewalls:
    login_area:
      pattern: ^/user/login$
      security: false

    secured_area:
      pattern: ^/admin
      anonymous: ~
      form_login:
        login_path: user/login
        check_path: user/login-check
        always_use_default_target_path: true
        default_target_path: /admin
        provider: db_provider

Every time I go to http://localhost:8000/admin it gives me this error
The check_path "user/login-check" for login method "form_login" is not matched by the firewall pattern "^/admin".

Invalid configuration for path "security.firewalls.secured_area": The check_path "user/login-check" for login method "form_login" is not matched by the firewall pattern "^/admin".

A:

Your login_check path must be covered by one of firewalls.
firewalls:
    login_area:
       pattern: ^/admin/user/login$
       security: false

    secured_area:
        pattern: ^/admin
        anonymous: ~
        form_login:
            login_path: /admin/user/login
            check_path: /admin/user/login-check
            always_use_default_target_path: true
            default_target_path: /admin
            provider: db_provider

access_control:
    - { path: ^/admin/user/login, role: IS_AUTHENTICATED_ANONYMOUSLY }

Note from symfony.com docs: 

Make sure that your check_path URL (e.g. /login) is behind the
  firewall you're using for your form login (in this example, the single
  firewall matches all URLs, including /login). If /login doesn't match
  any firewall, you'll receive a Unable to find the controller for path
  "/login" exception.

