File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -354,20 +354,14 @@ enabled
354
354
This option can be used to disable CSRF protection on *all * forms. But you
355
355
can also :ref: `disable CSRF protection on individual forms <form-csrf-customization >`.
356
356
357
- If you're using forms, but want to avoid starting your session (e.g. using
358
- forms in an API-only website), ``csrf_protection `` will need to be set to
359
- ``false ``.
360
-
361
- example:
362
-
363
357
.. configuration-block ::
364
358
365
359
.. code-block :: yaml
366
360
367
361
# config/packages/framework.yaml
368
362
framework :
369
363
# ...
370
- csrf_protection : true # can be true or false
364
+ csrf_protection : true
371
365
372
366
.. code-block :: xml
373
367
@@ -391,10 +385,14 @@ example:
391
385
use Symfony\Config\FrameworkConfig;
392
386
return static function (FrameworkConfig $framework) {
393
387
$framework->csrfProtection()
394
- ->enabled(true) #can be true or false
388
+ ->enabled(true)
395
389
;
396
390
};
397
391
392
+ If you're using forms, but want to avoid starting your session (e.g. using
393
+ forms in an API-only website), ``csrf_protection `` will need to be set to
394
+ ``false ``.
395
+
398
396
.. _config-framework-error_controller :
399
397
400
398
error_controller
You can’t perform that action at this time.
0 commit comments