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

Swoole deprecation errors for cookies with null values #641

Closed
oprypkhantc opened this issue Feb 3, 2023 · 1 comment · Fixed by #642
Closed

Swoole deprecation errors for cookies with null values #641

oprypkhantc opened this issue Feb 3, 2023 · 1 comment · Fixed by #642
Labels

Comments

@oprypkhantc
Copy link
Contributor

oprypkhantc commented Feb 3, 2023

  • Octane Version: 1.3.1
  • Laravel Version: 9.11
  • PHP Version: 8.1.9
  • Server & Version: Swoole 5.0.1

Description:

Out of the box, when you do cookie()->forget('cookie_name') Laravel saves a cookie with null value under the hood. This cookie is then fed into Swoole's response object here: https://github.com/laravel/octane/blob/1.x/src/Swoole/SwooleClient.php#L192, which in turn triggers a deprecation error from Swoole itself: Swoole\Http\Response::cookie(): Passing null to parameter #2 ($value) of type string is deprecated in /app/vendor/laravel/octane/src/Swoole/SwooleClient.php:200.

When either not using Octane at all or using Roadrunner, Symfony's Cookie class handles missing value by converting null cookie value to "deleted".

Steps To Reproduce:

Enable deprecation warnings; then do cookie()->forget('cookie_name') in an Octane Swoole server.

@driesvints
Copy link
Member

Thanks. I think the symfony solution is probably something we should follow. Can you send in a PR?

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