?
avatar cavo789
cavo789
23 Sep 2016

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().

Steps to reproduce the issue

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

Expected result

No warning

Actual result

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

System information (as much as possible)

Additional comments

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.

Votes

# of Users Experiencing Issue
1/1
Average Importance Score
5.00

avatar cavo789 cavo789 - open - 23 Sep 2016
avatar cavo789 cavo789 - change - 23 Sep 2016
The description was changed
avatar cavo789 cavo789 - edited - 23 Sep 2016
avatar wdj-ac
wdj-ac - comment - 26 Jan 2017

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.

avatar PhilETaylor
PhilETaylor - comment - 2 May 2017

Please test #15742

avatar franz-wohlkoenig franz-wohlkoenig - change - 2 May 2017
Status New Closed
Closed_Date 0000-00-00 00:00:00 2017-05-02 14:50:00
Closed_By franz-wohlkoenig
avatar joomla-cms-bot joomla-cms-bot - close - 2 May 2017
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 2 May 2017

closed as having PR #12153


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/12153.

avatar joomla-cms-bot joomla-cms-bot - edited - 2 May 2017
avatar joomla-cms-bot
joomla-cms-bot - comment - 2 May 2017

Add a Comment

Login with GitHub to post a comment