From 86f25a5db07031635ff587006bfe974cb10eeba2 Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Wed, 14 Mar 2018 15:14:37 +0200 Subject: [PATCH] MAGETWO-85983: [Backport for 2.1.x] Admin login always takes >30 sec when using Redis on 2.2.1 #12385 --- .../Magento/Framework/Session/SessionManager.php | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/lib/internal/Magento/Framework/Session/SessionManager.php b/lib/internal/Magento/Framework/Session/SessionManager.php index 872cbc6d9358c..f39e757ed6dcf 100644 --- a/lib/internal/Magento/Framework/Session/SessionManager.php +++ b/lib/internal/Magento/Framework/Session/SessionManager.php @@ -503,18 +503,9 @@ public function regenerateId() if (headers_sent()) { return $this; } - //@see http://php.net/manual/en/function.session-regenerate-id.php#53480 workaround + if ($this->isSessionExists()) { - $oldSessionId = session_id(); - session_regenerate_id(); - $newSessionId = session_id(); - session_id($oldSessionId); - session_destroy(); - - $oldSession = $_SESSION; - session_id($newSessionId); - session_start(); - $_SESSION = $oldSession; + session_regenerate_id(true); } else { session_start(); }