Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yii\web\Session with useCookies = false breaks on PHP 8.3.14 #20292

Closed
cebe opened this issue Dec 6, 2024 · 1 comment · Fixed by #20293
Closed

yii\web\Session with useCookies = false breaks on PHP 8.3.14 #20292

cebe opened this issue Dec 6, 2024 · 1 comment · Fixed by #20293
Assignees
Labels
Milestone

Comments

@cebe
Copy link
Member

cebe commented Dec 6, 2024

What steps will reproduce the problem?

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

Breaking Change in PHP: php/php-src@7cdd130 (php/php-src#16385)

Error:

[error][yii\base\ErrorException:2] yii\base\ErrorException: session_set_cookie_params(): Session cookies cannot be used when session.use_cookies is disabled in /var/www/layer5-live/vendor/yiisoft/yii2/web/Session.php:429
Stack trace:
#0 [internal function]: yii\base\ErrorHandler->handleError()
#1 /var/www/layer5-live/vendor/yiisoft/yii2/web/Session.php(429): session_set_cookie_params()
#2 /var/www/layer5-live/vendor/yiisoft/yii2/web/Session.php(147): yii\web\Session->setCookieParamsInternal()
#3 /var/www/layer5-live/vendor/yiisoft/yii2/web/Session.php(699): yii\web\Session->open()

What is the expected result?

yii\web\Session should not set cookie params when useCookies is false.

What do you get instead?

See error above.

Additional info

Q A
Yii version 2.0.49.3
PHP version 8.3.14
Operating system Debian Linux
@cebe cebe added the type:bug Bug label Dec 6, 2024
@cebe cebe self-assigned this Dec 6, 2024
cebe added a commit that referenced this issue Dec 6, 2024
…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.
cebe added a commit that referenced this issue Dec 6, 2024
…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.
@samdark samdark added this to the 2.0.52 milestone Dec 7, 2024
samdark pushed a commit that referenced this issue Dec 7, 2024
@cebe
Copy link
Member Author

cebe commented Dec 9, 2024

related to #20287

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants