Skip to content

Fix cookie processing issues#4586

Merged
Marsup merged 3 commits into
hapijs:masterfrom
kanongil:fix-state
Jul 22, 2026
Merged

Fix cookie processing issues#4586
Marsup merged 3 commits into
hapijs:masterfrom
kanongil:fix-state

Conversation

@kanongil

Copy link
Copy Markdown
Contributor

This fixes #4297, #4527 and #4316.

Not allowing cookies to be set on error 500 responses is an API change, but unlikely to affect usage. I made an effort to preserve cookie clears, since it can help avoid processing errors on future requests, and it doesn't have the same risk as setting a full cookie.

Not setting autoValue cookies when state parsing is disabled is not an API change as such, since this is how it already works in practice.

@kanongil kanongil added the bug Bug or defect label Jul 21, 2026
@kanongil

Copy link
Copy Markdown
Contributor Author

Note that regular responses with code 500 will still set state cookies.

@Marsup Marsup added this to the 21.4.10 milestone Jul 22, 2026
@Marsup Marsup self-assigned this Jul 22, 2026
@Marsup
Marsup merged commit 0124f0d into hapijs:master Jul 22, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Bug or defect

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error responses include state

2 participants