Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check if there is a valid session before messing with session ini values #15742

Closed
wants to merge 7 commits into from
Closed
17 changes: 10 additions & 7 deletions libraries/joomla/session/handler/joomla.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,6 @@ class JSessionHandlerJoomla extends JSessionHandlerNative
*/
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();
}
Expand Down Expand Up @@ -79,6 +72,16 @@ public function start()
}
}

// Only allow session config to be changed if no session yet started to avoid warnings
if ($this->getId() === "")
{
// 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');
}

return parent::start();
}

Expand Down