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::
408408 .. code-block :: php
409409
410410 // config/packages/security.php
411- $container->loadFromExtension('security', [
411+
412+ // ...
413+
414+ return static function (SecurityConfig $securityConfig): void {
412415 // ...
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+ };
430426
431427
432428 clear_site_data
@@ -483,19 +479,16 @@ It's also possible to use ``*`` as a wildcard for all directives:
483479 .. code-block :: php
484480
485481 // config/packages/security.php
486- $container->loadFromExtension('security', [
482+
483+ // ...
484+
485+ return static function (SecurityConfig $securityConfig): void {
487486 // ...
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+ };
499492
500493 .. versionadded :: 6.3
501494
You can’t perform that action at this time.
0 commit comments