Symfony 3.0.1 CSRF token present but invalid

前端 未结 7 2472
刺人心
刺人心 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条回答
  •  无人及你
    2021-02-14 10:24

    In my case it was that the var/sessions/ folder wasn't writable. The default is var/sessions which is set at config.yml.

    session:
        # http://symfony.com/doc/current/reference/configuration/framework.html#handler-id
        handler_id:  session.handler.native_file
        save_path:   "%kernel.root_dir%/../var/sessions/%kernel.environment%"
    

    Make sure you have var/ folders writable.

    chmod 775 -R var/sessions/
    chmod 775 -R var/log/
    chmod 775 -R var/cache/
    

提交回复
热议问题