Search code examples
formssymfonyphpunitcsrfcsrf-protection

Symfony2.1: The CSRF token is invalid. Only in browser, PHPUnit WebTestCase works without error


How can I debug why in all my browsers I got The CSRF token is invalid error, but when I test same form with Functional test it works?


Solution

  • When I commented my config.yml as below, everything started working? so new question is: What is wrong with commented part of this configuration?

    session:
        auto_start:     true
        # cookie_lifetime:   86400
        # cookie_path:       \
        # cookie_domain:     example.com
        # cookie_secure:     true
        # cookie_httponly:   true