Skip to content

Commit

Permalink
Auth: Prevent and log duplicate session_start
Browse files Browse the repository at this point in the history
(cherry picked from commit fe14110)
  • Loading branch information
mjansenDatabay committed Feb 13, 2025
1 parent 34344ab commit 9546ac2
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ protected function getLogger(): ilLogger
*/
public function init(): bool
{
if (session_status() === PHP_SESSION_ACTIVE) {
$this->getLogger()->error(__METHOD__ . ' called with active session.');
$this->getLogger()->logStack(ilLogLevel::ERROR);
return false;
}

session_start();

$this->setId(session_id());
Expand Down

0 comments on commit 9546ac2

Please sign in to comment.