Skip to content

Commit

Permalink
Auth: Prevent and log duplicate session_start
Browse files Browse the repository at this point in the history
  • Loading branch information
mjansenDatabay committed Feb 13, 2025
1 parent 7cdbf5f commit fe14110
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Services/Authentication/classes/class.ilAuthSession.php
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 fe14110

Please sign in to comment.