Skip to content

Commit

Permalink
Fix "ini_set(): Session ini settings cannot be changed after headers …
Browse files Browse the repository at this point in the history
…have already been sent"
  • Loading branch information
chihiro-adachi committed Jan 11, 2024
1 parent 2c456de commit a594346
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,11 @@ public function __construct(\SessionHandlerInterface $handler)

$this->handler = $handler;

ini_set('session.cookie_secure', $this->getCookieSecure());
ini_set('session.cookie_samesite', $this->getCookieSameSite());
ini_set('session.cookie_path', $this->getCookiePath());
if (!headers_sent()) {
ini_set('session.cookie_secure', $this->getCookieSecure());
ini_set('session.cookie_samesite', $this->getCookieSameSite());
ini_set('session.cookie_path', $this->getCookiePath());
}
}

/**
Expand Down

0 comments on commit a594346

Please sign in to comment.