10000 [FrameworkBundle] Allow to set null for the handler in NativeSessionS… · symfony/symfony@8e11aaa · GitHub
[go: up one dir, main page]

Skip to content

Commit 8e11aaa

Browse files
author
Drak
committed
[FrameworkBundle] Allow to set null for the handler in NativeSessionStorage
1 parent d3625b0 commit 8e11aaa

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,12 @@ private function registerSessionConfiguration(array $config, ContainerBuilder $c
294294
$container->setParameter('session.storage.options', $options);
295295

296296
// session handler (the internal callback registered with PHP session management)
297-
$container->setAlias('session.handler', $config['handler_id']);
297+
if (null == $config['handler_id']) {
298+
// Set the handler class to be null
299+
$container->getDefinition('session.storage.native')->replaceArgument(1, null);
300+
} else {
301+
$container->setAlias('session.handler', $config['handler_id']);
302+
}
298303

299304
$container->setParameter('session.save_path', $config['save_path']);
300305

0 commit comments

Comments
 (0)
0