From e01a3fdbcde86c91cd1a22d6a79053d961fb8505 Mon Sep 17 00:00:00 2001 From: Florin Patan Date: Wed, 15 Aug 2012 15:50:10 +0300 Subject: [PATCH] NativeFileSession won't override the php.ini settings anymore --- .../Session/Storage/Handler/NativeFileSessionHandler.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeFileSessionHandler.php b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeFileSessionHandler.php index f39235cbfb6a5..53591c0688988 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 that 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'); }