Skip to content

Documented the new csrf_token field prefix #10905

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 22, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions security/csrf.rst
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,15 @@ this can be customized on a form-by-form basis::
// ...
}

You can also customize the rendering of the CSRF form field creating a custom
:doc:`form theme </form/form_themes>` and using ``csrf_token`` as the prefix of
the field (e.g. define ``{% block csrf_token_widget %} ... {% endblock %}`` to
customize the entire form field contents).

.. versionadded:: 4.3

The ``csrf_token`` form field prefix was introduced in Symfony 4.3.

CSRF Protection in Login Forms
------------------------------

Expand Down