-
-
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
aiohttp not forwarding cookies with Session requests #3523
Comments
GitMate.io thinks the contributor most likely able to help you is @asvetlov. Possibly related issues are #2920 (AIOHttp failing after some requests), #161 (aiohttp can't send files by POST request correct), #206 (SSL issue with aiohttp.request), #139 (Cookies doesn't shared between requests), and #1756 (Memory leak with aiohttp.request). |
Sorry, your snippet has a lot of incomplete code. |
I will try, with a github project. that said, for your own sample projects, how do you forward cookies from incoming request headers? |
You need to do it explicitly. |
@asvetlov Can you point the documentation part for a per-request cookie insertion? The documentation only shows how to add cookies to sessions. |
Ah ok thanks, I guess you meant this aiohttp.request. I totally missed that "reference" page. |
I'm working on an api gateway service with aiohttp that executes an aggregate operation across a number of internal services and packages them up into a 207 bulk response.
Internally, we use a Django session cookie for the primary means of authentication (planning to move to JWTs in Q2 this year), which means that for the services being hit with this gateway, I need to pass through the cookie from the browser or rest API request.
It seems aiohttp is not doing this at all, nor is it making any cookies available in the Postman
Cookies
headers available. However, if I hit the service directly with the same cookies, I get the expected response back.Code right now:
Notes:
AsyncBreaker
usesaiobreaker
to use the Circuit Breaker pattern for protecting services from overload@cache
decorator is currently just wrapping the retrieve method and being used to inspect the attributes ofAggregateView
andClientSession
. Its going to be more full featured with aiocache once this issue is resolved.What do I need to do to ensure cookie headers from the incoming request get passed to the subsequent session calls?
The text was updated successfully, but these errors were encountered: