spring-projects / spring-projects/spring-session
Incompatibility with Apache Http Client 4.x due to Cookie Expires date format
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.9k
- Forks
- 1.2k
- Avg merge
- 4h 27m
- Merged PRs (30d)
- 55
Description
Describe the bug
With Commit https://github.com/spring-projects/spring-session/commit/00465a6f00bef564796c4a34a9228efb5fe6ede9 you created your own implementation of the Set-Cookie header in DefaultCookieSerializer.writeCookieValue(...). But the date format in the Expires field is not spec compliant to the Netscape Draft spec. With the change you set the date format to RFC1123 which has spaces in between the date fields, but the original spec requires dashes in between the date fields.
We encountered this issue, when using Apache Http Client 4.x against one of our servers. Apache Http Client 4.x support the Netscape Draft Spec, RFC2109 and RFC2965. If the expires field is present, it defaults to the Netscape Draft Spec and the date format with dashes. Code It then continues to fail to parse the Session Cookie.
Apache Http Clients version 5.x are okay, because then the RFC6265 is used.
Feel free to close this ticket, if you think it's not necessary to support these old clients anymore.
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 at DefaultCookieSerializer.writeCookieValue and compare the Expires date format with the Netscape Draft requirements described in the issue. Reproduce the parsing failure with Apache Http Client 4.x if available. Done means the generated session cookie can be parsed by Apache Http Client 4.x while remaining compatible with the documented cookie behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100