Search code examples
phpsymfonycsrf

How can I turn of CSRF protection globally on Symfony 3 with FOSUserBundle


I am having a sessions issue that results "Failed to start the session: already started by PHP.". As a temporary workaround, I wan't to disable CSRF protection globally, including FOSUserBundle. How can I do this?


Solution

  • try this available at doc :

    framework:
        csrf_protection:
            enabled:   false
    

    and if you need to disable it also in login form you just go to your security.yml file and remove the csrf_provider from the form_login directive, don't need to update the action class or anything.