musicmaster Posted February 13 Share Posted February 13 (edited) Suddenly I had in my PS 8.2 a "Failed to start the session" error that blocked me from entering my backoffice. I tried emptying the cache and deleting the browser cookies but without effect. What finally helped was forcing Prestashop to create a new session key. The error happened on line 193 of /vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php This was the relevant code: if ($sessionId && $this->saveHandler instanceof AbstractProxy && 'files' === $this->saveHandler->getSaveHandlerName() && !preg_match('/^[a-zA-Z0-9,-]{22,250}$/', $sessionId)) { // the session ID in the header is invalid, create a new one session_id(session_create_id()); } // ok to try and start the session if (!session_start()) { throw new \RuntimeException('Failed to start the session.'); } What helped was changing it to: if ($sessionId && $this->saveHandler instanceof AbstractProxy && 'files' === $this->saveHandler->getSaveHandlerName() && !preg_match('/^[a-zA-Z0-9,-]{22,250}$/', $sessionId)) { // the session ID in the header is invalid, create a new one session_id(session_create_id()); } session_id(session_create_id()); /* ADDED CODE */ // ok to try and start the session if (!session_start()) { throw new \RuntimeException('Failed to start the session.'); } Of course after I had successfully logged in into the backoffice I undid this change. Edited February 13 by musicmaster (see edit history) Link to comment Share on other sites More sharing options...
Ewonta Posted February 14 Share Posted February 14 This usually happens when your hosting or server has session recording disabled. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now