From 5dd7d4fbc323cf8a506d928cb0827f4f7d656a2e Mon Sep 17 00:00:00 2001 From: Thomas Steur Date: Thu, 11 Jun 2020 08:17:10 +1200 Subject: [PATCH] Fix falsely assumes session was already started (#16047) fix https://wordpress.org/support/topic/an-error-occurred-session-already-started/#topic-12961322-replies The code should actually not be needed as we added a while ago `session_status()` to correctly check if a session is already active or not. SID constant is not realiable. In this case problem was this https://3v4l.org/bpUFK Basically a session was started by some other plugin causing the SID constant to be set. The plugin also directly closed the session again so we still attempted to start the session (which is correct). But then Zend falsely assumes session is started because of the SID constant when there is actually no session. SID is not reliable for this purpose and be better to rely on `session_status()` which we added a while backa --- libs/Zend/Session.php | 7 ------- 1 file changed, 7 deletions(-) diff --git a/libs/Zend/Session.php b/libs/Zend/Session.php index 21451e0ffaa..f0979206135 100644 --- a/libs/Zend/Session.php +++ b/libs/Zend/Session.php @@ -478,13 +478,6 @@ public static function start($options = false) . " output started in {$filename}/{$linenum}"); } - // See http://www.php.net/manual/en/ref.session.php for explanation - if (!self::$_unitTestEnabled && defined('SID')) { - /** @see Zend_Session_Exception */ - // require_once 'Zend/Session/Exception.php'; - throw new Zend_Session_Exception('session has already been started by session.auto-start or session_start()'); - } - /** * Hack to throw exceptions on start instead of php errors * @see http://framework.zend.com/issues/browse/ZF-1325