cookie header with multiple cookies and the same key is handled incorrectly
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 443
- Forks
- 206
- PR merge metrics
- No merged PRs in 30d
Description
According to this SO answer and the referenced sections from the RFCs, a request can specify multiple values for a cookie. Currently, webob keeps only the last mentioned value, which is wrong, since the order of the cookies sent has the ones with highest priority first. If we were to keep only one version, it should be the first one.
Also, the documentation says that req.cookie is a MultiDict which currently is incorrect.
IMO, it should either keep being a simple dict, but keep the first value as it appears in the header, or become a MultiDict which for each key has a list of the cookie values as it appears in the header.
What do you think?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the req.cookie behavior described in the issue and docs/reference.txt around line 289, then review the linked RFC material and Stack Overflow answer. The issue names no implementation or test file and leaves the desired dict versus MultiDict behavior unresolved; done requires an agreed duplicate-cookie behavior and corresponding documentation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100