Answer the question
In order to leave comments, you need to log in
How to transfer multiple cookies?
How to pass multiple cookies using the headers parameter
https://docs.aiohttp.org/en/stable/web_reference.h...
Passing one cookie works.
headers = {"Set-Cookie": "key=value"}
return web.Response(..., headers=headers)
headers = {"Set-Cookie": "key=value", "Set-Cookie": "key=value"}
return web.Response(..., headers=headers)
Parameter headers of aiohttp.web_response.Response.__init__ headers: Union[Mapping[Union[str, istr], str], CIMultiDict[str], CIMultiDict, CIMultiDictProxy[str], CIMultiDictProxy, None]
< Python 3.8 (pythonProject) >
Answer the question
In order to leave comments, you need to log in
So you can try:
response = web.Response()
response.set_cookie('name_1', 'value_1')
response.set_cookie('name_2', 'value_2')
return response
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question