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

Store cookies with the same name if they have different paths #3627

Closed
wants to merge 4 commits into from

Conversation

jsagarribay
Copy link

@jsagarribay jsagarribay commented Feb 27, 2019

What do these changes do?

Do not overwrite cookies when they have different paths, even if they have the same name and domain

Are there changes in behavior for the user?

Without this change, if the server sets the same cookie (for example JSESSIONID) in several paths the cookie will be overwritten after each request and the session will get lost.

With this change aiohttp will do the same as browsers and store both cookies.

Checklist

  • I think the code is well written
  • Unit tests for the changes exist
  • Documentation reflects the changes
  • If you provide code modification, please add yourself to CONTRIBUTORS.txt
    • The format is <Name> <Surname>.
    • Please keep alphabetical order, the file is sorted by names.
  • Add a new news fragment into the CHANGES folder
    • name it <issue_id>.<type> for example (588.bugfix)
    • if you don't have an issue_id change it to the pr id after creating the pr
    • ensure type is one of the following:
      • .feature: Signifying a new feature.
      • .bugfix: Signifying a bug fix.
      • .doc: Signifying a documentation improvement.
      • .removal: Signifying a deprecation or removal of public API.
      • .misc: A ticket has been closed, but it is not of interest to users.
    • Make sure to use full sentences with correct case and punctuation, for example: "Fix issue with non-ascii contents in doctest text files."

@jsagarribay jsagarribay changed the title Cookies Store cookies with the same name if they have different paths Feb 27, 2019
@codecov-io
Copy link

Codecov Report

Merging #3627 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #3627      +/-   ##
=========================================
+ Coverage    97.9%   97.9%   +<.01%     
=========================================
  Files          43      43              
  Lines        8556    8557       +1     
  Branches     1376    1376              
=========================================
+ Hits         8377    8378       +1     
  Misses         74      74              
  Partials      105     105
Impacted Files Coverage Δ
aiohttp/cookiejar.py 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 398b5ba...1874281. Read the comment docs.

@PhotonQuantum
Copy link

@asvetlov @webknjaz It seems that this PR has been open for quite a long time. The issue solved by this PR prevents aiohttp from behaving correctly on a significant number of sites using tomcat, which sends JSESSIONID cookie in different paths under the same domain. Any reviews on it?

@CLAassistant

This comment has been minimized.

This was referenced Feb 25, 2022
@Dreamsorcerer
Copy link
Member

Sorry this didn't get reviewed earlier. Has been superseded by #6638.

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.

5 participants