Skip to content

Commit a26055f

Browse files
committed
feature #28447 [HttpFoundation] make cookies auto-secure when passing them $secure=null + plan to make it and samesite=lax the defaults in 5.0 (nicolas-grekas)
This PR was merged into the 4.2-dev branch. Discussion ---------- [HttpFoundation] make cookies auto-secure when passing them $secure=null + plan to make it and samesite=lax the defaults in 5.0 | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | yes | Tests pass? | yes | Fixed tickets | #26731 | License | MIT | Doc PR | - By creating Cookie instances using `null` for the `$secure` argument, this PR allows making cookies inherit their "secure" attribute from the request. This PR also adds a forward to make $secure=null and samesite=lax the defaults in Symfony 5.0: - either define all constructor's arguments explicitly - or use the new `Cookie::create()` factory Commits ------- 9493cfd5f2 [HttpFoundation] make cookies auto-secure when passing them $secure=null + plan to make it and samesite=lax the defaults in 5.0
2 parents 82de641 + 49b781b commit a26055f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

DependencyInjection/FrameworkExtension.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,9 @@ public function load(array $configs, ContainerBuilder $container)
199199
if ($this->isConfigEnabled($container, $config['session'])) {
200200
$this->sessionConfigEnabled = true;
201201
$this->registerSessionConfiguration($config['session'], $container, $loader);
202+
if (!empty($config['test'])) {
203+
$container->getDefinition('test.session.listener')->setArgument(1, '%session.storage.options%');
204+
}
202205
}
203206

204207
if ($this->isConfigEnabled($container, $config['request'])) {

0 commit comments

Comments
 (0)