I'm trying to upgrade to PHP 4.5 and everything is going flawless except logging out.
CakePHP 4.5.5
CakePHP/Authorisation 2.10.2
When logging out in:
APP/Controller/UsersController.php
public function logout()
{
$result = $this->Authentication->getResult();
if ($result->isValid()) {
$this->Authentication->logout();
return $this->redirect(['controller' => 'Users', 'action' => 'login']);
}
}
I'm going to:
ROOT/vendor/cakephp/authentication/src/Controller/Component/AuthenticationComponent.php at line311 in Authentication\AuthenticationService->clearIdentity
$result = $this->getAuthenticationService()->clearIdentity(
$controller->getRequest(),
$controller->getResponse()
);
And further:
ROOT/vendor/cakephp/authentication/src/AuthenticationService.php at line224 in Authentication\Authenticator\SessionAuthenticator->clearIdentity
$result = $authenticator->clearIdentity($request, $response);
And it wants to renew the session:
ROOT/vendor/cakephp/authentication/src/Authenticator/SessionAuthenticator.php at line115 in Cake\Http\Session->renew
$sessionKey = $this->getConfig('sessionKey');
/** @var \Cake\Http\Session $session */
$session = $request->getAttribute('session');
$session->delete($sessionKey);
$session->renew();
It starts the new session
CORE/src/Http/Session.php at line649 in Cake\Http\Session->start
if (!$this->_hasSession() || $this->_isCLI) {
return;
}
$this->start();
$params = session_get_cookie_params();
And crashes here:
CORE/src/Http/Session.php at line 352
if (session_status() === \PHP_SESSION_ACTIVE) {
throw new RuntimeException('Session was already started');
}
This seems strange to me, code worked fine for CakePHP 4.3.