-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
ClientSession cookies not expiring #4063
Comments
Thanks for the report.
|
@asvetlov Understood on the test suite. Actually found a potential fix but it breaks the existing test suite which I think may have an incorrect assumption. Before I do anything further I want to make sure I was aligned on the proper behavior. Please see my comment in the PR. |
Fixed by #4066 |
Long story short
Using a ClientSession where the server sends cookies with an
expires
date in the past results in the cookies remaining in the cookie_jar that are then sent in subsequent requests.Expected behaviour
If a server sends an expired cookie, it should remove that entry from the cookie_jar if it exists.
Actual behaviour
The expired cookie remains in the cookie_jar and is sent in the header of the next response.
Steps to reproduce
Session creation code
Get/post example code
Providing debug logs from my use case as the actual code flow is a bit complex. Hopefully the debug logs can explain the issue. I will annotate below.
Get request and headers:
Response from server:
Please notice the cookies for the
.www.amazon.es
domain that expire in2007
with value of-
. They will be sent in the next post.Subsequent post within the same session; notice the cookies with value
-
sent in the headerYour environment
aiohttp 3.5.4
client
The text was updated successfully, but these errors were encountered: