8000 NativeFileSession won't override the php.ini settings anymore · symfony/symfony@314c16b · GitHub
[go: up one dir, main page]

Skip to content

Commit 314c16b

Browse files
committed
NativeFileSession won't override the php.ini settings anymore
1 parent 50df1a7 commit 314c16b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeFileSessionHandler.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,13 @@ class NativeFileSessionHandler extends NativeSessionHandler
3333
*/
3434
public function __construct($savePath = null)
3535
{
36+
// We don't want to override the server settings in case the server is configured to handle sessions
37+
// in something else than files. This makes it easy to configure servers to have sessions stored in
38+
// memcached/redis or anything else from PHP.ini
39+
if ('files' != ini_get('session.save_handler')) {
40+
return;
41+
}
42+
3643
if (null === $savePath) {
3744
$savePath = ini_get('session.save_path');
3845
}

0 commit comments

Comments
 (0)
0