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

Updating cookie-parsing regex to be more aligned with RFC 6265 #207

Open
wants to merge 1 commit into
base: 3.6.x
Choose a base branch
from

Conversation

check24-denis
Copy link

Q A
Documentation no
Bugfix yes
BC Break yes/no
New Feature no
RFC no
QA yes/no

Description

Regex inside parseCookieHeader is not totally in alignment with RFC 6265. This PR aims to fix two moments:

  1. When cookie header does not have a space in between values, e.g. test1=test;test2=test. Previously this led to an empty cookie array (or in versions less than 3.* to a fallback using $_COOKIE array).
  2. When cookie header contains square brackets in names, e.g. test[test1]=test; test[test2]=test2. This should solve an exissting issue, I believe: Array cookies not parser properly #7.

I've added tests for these cases.

@check24-denis check24-denis force-pushed the cookie-parsing-regex-update branch from ff53764 to d147c63 Compare January 7, 2025 16:16
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.

1 participant