User tests: Successful: 0 Unsuccessful: 0
This is an adapted version of PR 21260 for Joomla! 4.0
The original problem was, that Joomla! displayed an error message with an exception when a PHP session was started, before Joomla! is starting. Joomla tries to change ini values, what is forbidden by PHP so an exception is thrown and displayed to the user.
In contrast to Joomla! 3.8, Joomla! 4.0 still displays an error message if there is an active PHP session, but without showing the actual exception. This is caused by /libraries/vendor/joomla/session/src/Storage/NativeStorage.php
:
public function setName(string $name)
{
if ($this->isActive())
{
throw new \LogicException('Cannot change the name of an active session');
}
session_name($name);
return $this;
}
Added two checks for an active PHP session, so no exception is displayed to the user.
The easiest way to start Joomla! in an active PHP session is to add the line
session_start();
in the beginning of the index.php
No error message/Error message without exception showing file paths
Exception showing file path
My Question:
Should the current behavior of Joomla! 4.0 refusing to start in an active PHP session be implemented in Joomla! 3.8 as well? Or is Joomla! 3.8's way to handle this correct? It just suppresses the exception.
If Joomla! starts in an active PHP session it can't set the session_cache_limiter
to none
and the cookie settings can't be applied.
(I messed up, so it's 4 commits, but it's just the two changed lines)
Status | New | ⇒ | Pending |
Category | ⇒ | Libraries |
Labels |
Added:
?
|
Status | Pending | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2018-08-01 15:28:00 |
Closed_By | ⇒ | wilsonge |
Thanks for your patience :)