Skip to content

Symfony 5.3: the csrf token is invalid on all form protected by CSRF when using "remember me"  #41707

Closed
@allan-simon

Description

@allan-simon

Symfony version(s) affected: 5.3.1

Description

I've upgraded from Symfony 5.2 to 5.3.1 and since then, in production submitting any form protected by CSRF fail with

the csrf token is invalid. please try to resubmit the form

Even form not handle by me (for example I have EasyAdminBundle and they fail too)

How to reproduce

  1. Install Symfony + EasyAdminBundle
  2. for session I use
framework:
    session:
        handler_id: Symfony\Component\HttpFoundation\Session\Storage\Handler\PdoSessionHandler
        cookie_secure: auto
        cookie_samesite: lax

3.login in EasyAdmin
4. try to submit a form -> you got the error

Possible Solution

Additional context

Is it related to #39919 ?

it happens only in production

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions