Skip to content

Commit c9f72e2

Browse files
[SecurityBundle] Fix compat with HttpFoundation >=3.4
1 parent 5b997f1 commit c9f72e2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/AbstractFactory.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Symfony\Component\DependencyInjection\ChildDefinition;
1616
use Symfony\Component\DependencyInjection\ContainerBuilder;
1717
use Symfony\Component\DependencyInjection\Reference;
18+
use Symfony\Component\HttpFoundation\Session\Storage\Handler\AbstractSessionHandler;
1819

1920
/**
2021
* AbstractFactory is the base class for all classes inheriting from
@@ -29,7 +30,7 @@ abstract class AbstractFactory implements SecurityFactoryInterface
2930
protected $options = array(
3031
'check_path' => '/login_check',
3132
'use_forward' => false,
32-
'require_previous_session' => true,
33+
'require_previous_session' => null,
3334
);
3435

3536
protected $defaultSuccessHandlerOptions = array(
@@ -80,6 +81,10 @@ public function addConfiguration(NodeDefinition $node)
8081
->scalarNode('failure_handler')->end()
8182
;
8283

84+
if (array_key_exists('require_previous_session', $this->options) && null === $this->options['require_previous_session']) {
85+
$this->options['require_previous_session'] = !class_exists(AbstractSessionHandler::class);
86+
}
87+
8388
foreach (array_merge($this->options, $this->defaultSuccessHandlerOptions, $this->defaultFailureHandlerOptions) as $name => $default) {
8489
if (is_bool($default)) {
8590
$builder->booleanNode($name)->defaultValue($default);

0 commit comments

Comments
 (0)