Skip to content

[Form] Rename CSRF token field from _token to _csrf_token #60534

@ThomasLandauer

Description

@ThomasLandauer

Description

I'm suggesting to change the default name of the automatically generated CSRF token form field from _token to _csrf_token.
I think it's happening at https://github.com/symfony/symfony/blob/7.3/src/Symfony/Component/Form/Extension/Csrf/Type/FormTypeCsrfExtension.php#L35

Oddly enough, the docs at https://symfony.com/doc/current/security/csrf.html#csrf-protection-in-symfony-forms are falsely claiming that it is called _csrf_token. But instead of changing the docs, I'm suggesting to change the feature, cause _csrf_token is certainly a better name.

Example

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions