Symfony 3.0.1 CSRF token present but invalid

前端 未结 7 2448
刺人心
刺人心 2021-02-14 09:33

I am having this strange issue with a fresh Symfony 3.0.1 installation. I generated a new CRUD Controller with a Form PostType which contains an url and a title. Nothing fancy.<

7条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-14 10:12

    I experienced a similar problem with Symfony 4.2 when switching from dev to test environment.

    I had the following setting in my framework.yaml file:

    framework:
        session:
            storage_id: session.storage.mock_file
    

    Solution:

    Removing the storage_id: session.storage.mock_file-setting solved the problem.

    Important: You probably have to clear the cache for this to take effect.

    For more information about the storage_id-configuration option also see here.

提交回复
热议问题