? Pending

User tests: Successful: Unsuccessful:

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;
 }

Summary of Changes

Added two checks for an active PHP session, so no exception is displayed to the user.

Testing Instructions

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

Expected result

No error message/Error message without exception showing file paths

Actual result

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)

avatar niklas-deworetzki-thm niklas-deworetzki-thm - open - 1 Aug 2018
avatar niklas-deworetzki-thm niklas-deworetzki-thm - change - 1 Aug 2018
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 1 Aug 2018
Category Libraries
avatar niklas-deworetzki-thm niklas-deworetzki-thm - change - 1 Aug 2018
Labels Added: ?
avatar wilsonge wilsonge - change - 1 Aug 2018
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2018-08-01 15:28:00
Closed_By wilsonge
avatar wilsonge wilsonge - close - 1 Aug 2018
avatar wilsonge wilsonge - merge - 1 Aug 2018
avatar wilsonge
wilsonge - comment - 1 Aug 2018

Thanks for your patience :)

Add a Comment

Login with GitHub to post a comment