Skip to content

Commit aa5132a

Browse files
[Security] Migrate to ConfigBuilder format for 6.3+
1 parent 4e3a968 commit aa5132a

File tree

1 file changed

+23
-30
lines changed

1 file changed

+23
-30
lines changed

reference/configuration/security.rst

Lines changed: 23 additions & 30 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)