File tree Expand file tree Collapse file tree 1 file changed +23
-30
lines changed Expand file tree Collapse file tree 1 file changed +23
-30
lines changed Original file line number Diff line number Diff line change @@ -408,25 +408,21 @@ user logs out::
408
408
.. code-block :: php
409
409
410
410
// config/packages/security.php
411
- $container->loadFromExtension('security', [
411
+
412
+ // ...
413
+
414
+ return static function (SecurityConfig $securityConfig): void {
412
415
// ...
413
- 'firewalls' => [
414
- 'main' => [
415
- 'logout' => [
416
- 'delete_cookies' => [
417
- 'cookie1-name' => null,
418
- 'cookie2-name' => [
419
- 'path' => '/',
420
- ],
421
- 'cookie3-name' => [
422
- 'path' => null,
423
- 'domain' => 'example.com',
424
- ],
425
- ],
426
- ],
427
- ],
428
- ],
429
- ]);
416
+
417
+ $securityConfig->firewall('main')
418
+ ->logout()
419
+ ->deleteCookie('cookie1-name')
420
+ ->deleteCookie('cookie2-name')
421
+ ->path('/')
422
+ ->deleteCookie('cookie3-name')
423
+ ->path(null)
424
+ ->domain('example.com');
425
+ };
430
426
431
427
432
428
clear_site_data
@@ -483,19 +479,16 @@ It's also possible to use ``*`` as a wildcard for all directives:
483
479
.. code-block :: php
484
480
485
481
// config/packages/security.php
486
- $container->loadFromExtension('security', [
482
+
483
+ // ...
484
+
485
+ return static function (SecurityConfig $securityConfig): void {
487
486
// ...
488
- 'firewalls' => [
489
- 'main' => [
490
- 'logout' => [
491
- 'clear-site-data' => [
492
- 'cookies',
493
- 'storage',
494
- ],
495
- ],
496
- ],
497
- ],
498
- ]);
487
+
488
+ $securityConfig->firewall('main')
489
+ ->logout()
490
+ ->clearSiteData(['cookies', 'storage']);
491
+ };
499
492
500
493
.. versionadded :: 6.3
501
494
You can’t perform that action at this time.
0 commit comments