File tree Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -1781,6 +1781,8 @@ The CSRF token can be customized on a form-by-form basis. For example::
17811781 // ...
17821782 }
17831783
1784+ .. _form-disable-csrf :
1785+
17841786To disable CSRF protection, set the ``csrf_protection `` option to false.
17851787Customizations can also be made globally in your project. For more information,
17861788see the :ref: `form configuration reference <reference-framework-form >`
Original file line number Diff line number Diff line change @@ -218,8 +218,11 @@ enabled
218218
219219Whether or not to enable support for the Form component.
220220
221- You will also have to disable form support if you want to
222- :ref: `disable the validation support <validation-enabled >`.
221+ If you don't use forms, setting this to ``false `` may increase your application's
222+ performance because less services will be loaded into the container.
223+
224+ If this is activated, the :ref: `validation system <validation-enabled >`
225+ is also enabled automatically.
223226
224227csrf_protection
225228~~~~~~~~~~~~~~~
@@ -232,9 +235,12 @@ enabled
232235**type **: ``boolean `` **default **: ``true `` if form support is enabled, ``false ``
233236otherwise
234237
235- This option can be used to disable CSRF protection of forms. You need to
236- disable CSRF protection to be able to disable session. For example, this
237- is useful when you only use forms in an API-only website.
238+ This option can be used to disable CSRF protection on *all * forms. But you
239+ can also :ref: `disable CSRF protection on individual forms <form-disable-csrf >`.
240+
241+ If you're using forms, but want to avoid starting your session (e.g. using
242+ forms in an API-only website), ``csrf_protection `` will need to be set to
243+ ``false ``.
238244
239245field_name
240246..........
You can’t perform that action at this time.
0 commit comments