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 3cff986
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions framework/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Yii Framework 2 Change Log
2.0.52 under development
------------------------

- Bug #20292: Fix `\yii\web\Session` should not set cookie params, when useCookie is false (cebe)
- Bug #20232: Fix regression introduced in `GHSA-cjcc-p67m-7qxm` while attaching behavior defined by `__class` array key (erickskrauch)
- Bug #20231: Fix regression introduced in #20167 in `yii\validators\FileValidator` (bizley)
- Enh #20247: Support for variadic console controller action methods (brandonkelly)
Expand Down
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 3cff986

Please sign in to comment.