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 @@ -1776,6 +1776,8 @@ The CSRF token can be customized on a form-by-form basis. For example::
17761776 // ...
17771777 }
17781778
1779+ .. _form-disable-csrf :
1780+
17791781To disable CSRF protection, set the ``csrf_protection `` option to false.
17801782Customizations can also be made globally in your project. For more information,
17811783see the :ref: `form configuration reference <reference-framework-form >`
Original file line number Diff line number Diff line change @@ -227,8 +227,11 @@ enabled
227227
228228Whether or not to enable support for the Form component.
229229
230- You will also have to disable form support if you want to
231- :ref: `disable the validation support <validation-enabled >`.
230+ If you don't use forms, setting this to ``false `` may increase your application's
231+ performance because less services will be loaded into the container.
232+
233+ If this is activated, the :ref: `validation system <validation-enabled >`
234+ is also enabled automatically.
232235
233236csrf_protection
234237~~~~~~~~~~~~~~~
@@ -241,9 +244,12 @@ enabled
241244**type **: ``boolean `` **default **: ``true `` if form support is enabled, ``false ``
242245otherwise
243246
244- This option can be used to disable CSRF protection of forms. You need to
245- disable CSRF protection to be able to disable session. For example, this
246- is useful when you only use forms in an API-only website.
247+ This option can be used to disable CSRF protection on *all * forms. But you
248+ can also :ref: `disable CSRF protection on individual forms <form-disable-csrf >`.
249+
250+ If you're using forms, but want to avoid starting your session (e.g. using
251+ forms in an API-only website), ``csrf_protection `` will need to be set to
252+ ``false ``.
247253
248254field_name
249255..........
You can’t perform that action at this time.
0 commit comments