Hello guys
In my PHP application, I'm interfacing the Joomla!® framework for retrieving the list of versions and being able to suggest to my users that their version is an old one. Quite easy.
By loading the framework; I receive this warning :
[E_WARNING] [2016-09-23 13:32:27 (CEST)] [File xxxx/libraries/joomla/session/handler/joomla.php] [Line 45] ==> ini_set(): A session is active. You cannot change the session module's ini settings at this time
This happens because, in my own code, I've already started a session.
Could be easily solved by checking session_id().
The current code in /libraries/joomla/session/handler/joomla.php is :
public function __construct($options = array())
{
// Disable transparent sid support
ini_set('session.use_trans_sid', '0');
// Only allow the session ID to come from cookies and nothing else.
ini_set('session.use_only_cookies', '1');
// Set options
$this->setOptions($options);
$this->setCookieParams();
}
No warning
A warning is displayed :
[E_WARNING] [2016-09-23 13:32:27 (CEST)] [File xxxx/libraries/joomla/session/handler/joomla.php] [Line 45] ==> ini_set(): A session is active. You cannot change the session module's ini settings at this time
By changing the code like below, the warning dissapear. Can this change be done in Joomla ? Don't know if there will be side effect.
public function __construct($options = array())
{
if (session_id()==0)
{
// Disable transparent sid support
ini_set('session.use_trans_sid', '0');
// Only allow the session ID to come from cookies and nothing else.
ini_set('session.use_only_cookies', '1');
}
// Set options
$this->setOptions($options);
$this->setCookieParams();
}
Thanks a lot.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-05-02 14:50:00 |
Closed_By | ⇒ | franz-wohlkoenig |
closed as having PR #12153
Set to "closed" on behalf of @franz-wohlkoenig by The JTracker Application at issues.joomla.org/joomla-cms/12153
Get the same errors in my logs.
Joomla 3.6.5
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/12153.