diff --git a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeFileSessionHandler.php b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeFileSessionHandler.php index f39235cbfb6a..e1fe8b301f56 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeFileSessionHandler.php +++ b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeFileSessionHandler.php @@ -33,6 +33,13 @@ class NativeFileSessionHandler extends NativeSessionHandler */ public function __construct($savePath = null) { + // We don't want to override the server settings in case the server is configured to handle sessions + // in something else than files. This makes it easy to configure servers to have sessions stored in + // memcached/redis or anything else from PHP.ini + if ('files' != ini_get('session.save_handler')) { + return; + } + if (null === $savePath) { $savePath = ini_get('session.save_path'); }