Skip to content

Commit

Permalink
Fix #20292: yii\web\Session should not set cookie params, when useCoo…
Browse files Browse the repository at this point in the history
…kies is false

Upgrading from PHP 8.3.7 to 8.3.14 breaks yii\web\Session when used with useCookies = false.

Error: Session cookies cannot be used when session.use_cookies is disabled.
  • Loading branch information
cebe committed Dec 6, 2024
1 parent 65e3369 commit 436006d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion framework/web/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,9 @@ public function open()

$this->registerSessionHandler();

$this->setCookieParamsInternal();
if ($this->getUseCookies() !== false) {
$this->setCookieParamsInternal();
}

YII_DEBUG ? session_start() : @session_start();

Expand Down

0 comments on commit 436006d

Please sign in to comment.