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

Simple cookie parser keeps first cookie with same name, not most recently set #1831

Open
lvpiao opened this issue Aug 30, 2022 · 2 comments · May be fixed by #1835
Open

Simple cookie parser keeps first cookie with same name, not most recently set #1831

lvpiao opened this issue Aug 30, 2022 · 2 comments · May be fixed by #1835

Comments

@lvpiao
Copy link

lvpiao commented Aug 30, 2022

image

@lvpiao lvpiao changed the title I recently ran into an issue and found out that the reason was that the first cookie was kept after a request, which is different from the browser's behavior I recently encountered a problem and found that the reason is that when there are multiple Set-Cookies setting the same cookie in the header of a response, only the first cookie is retained, which is different from the browser's behavior Aug 30, 2022
lvpiao added a commit to lvpiao/jsoup that referenced this issue Sep 7, 2022
lvpiao added a commit to lvpiao/jsoup that referenced this issue Sep 7, 2022
@jeffthomasweb
Copy link

Hi, to help others duplicate this issue, can you please include a code sample and the error you receive? Thanks!

@lvpiao
Copy link
Author

lvpiao commented Sep 12, 2022

image
image

As shown in the figures, if there are two identical Set-Cookie in the response header, the browser (e.g. Edge) will save the second one, however Jsoup will save the first one, and when the subsequent request carrie that cookie, the exception will occur.

@jhy jhy linked a pull request Jan 5, 2023 that will close this issue
@jhy jhy changed the title I recently encountered a problem and found that the reason is that when there are multiple Set-Cookies setting the same cookie in the header of a response, only the first cookie is retained, which is different from the browser's behavior Simple cookie parser keeps first cookie with same name, not most recently set Jan 5, 2023
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 a pull request may close this issue.

2 participants