Skip to content

[13.x] Fix named arguments in Cookie::queue() - #62246

Merged
taylorotwell merged 1 commit into
laravel:13.xfrom
xurshudyan:cookie-queue-named-arguments
Oct 29, 2026
Merged

taylorotwell merged 1 commit into
laravel:13.xfrom
xurshudyan:cookie-queue-named-arguments

Conversation

@xurshudyan

Copy link
Copy Markdown
Contributor

Named arguments passed to Cookie::queue() end up in the wrong parameters:

Cookie::queue('foo', 'bar', 60, secure: true, sameSite: 'none');

// path: '1', domain: 'none', secure: false

queue() passes its arguments through array_values(), which dates back to #34884 and turns named arguments into positional ones. Cookie::make() handles the same call correctly.

@taylorotwell
taylorotwell merged commit 1f8b053 into laravel:13.x Oct 29, 2026
64 checks passed
albertcht pushed a commit to hypervel/cookie that referenced this pull request Nov 3, 2026
CookieJar::queue() passed its variadic parameters through
array_values() before spreading them into make(), so named arguments
such as Cookie::queue('name', 'value', secure: true) lost their names
and failed with a TypeError.

The parameters are now spread directly. Ports laravel/framework#62246
from 13.x at b20bf7f442.

Tests: ported testQueueWithNamedArguments to CookieJarTest; it fails
before the fix. The file passes.
binaryfire added a commit to hypervel/components-backup that referenced this pull request Nov 3, 2026
CookieJar::queue() passed its variadic parameters through
array_values() before spreading them into make(), so named arguments
such as Cookie::queue('name', 'value', secure: true) lost their names
and failed with a TypeError.

The parameters are now spread directly. Ports laravel/framework#62246
from 13.x at b20bf7f442.

Tests: ported testQueueWithNamedArguments to CookieJarTest; it fails
before the fix. The file passes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants