I am trying to return multiple Set-Cookie statements in my header. However, it doesn't work given that key within the dictionary is the same for both cookies and therefore, only the 2nd Set-Cookie is been returned resp. actually been added to the dict.
"headers": {
"Set-Cookie": "refreshToken=myToken1; httpOnly; secure; path=/auth/refresh/;",
"Set-Cookie": "accessToken=myToken;2 httpOnly; secure; path=/;"
}
Is there solution to this problem in chalice?
I'm not sure that API Gateway supports this, even if Chalice could, per https://forums.aws.amazon.com/thread.jspa?threadID=205782
Some workarounds are mentioned in the thread (e.g. Set-Cookie/SEt-Cookie), but they might not apply to your situation. In general you can try to stick multiple cookies in one header, separating them with a comma, but this is also questionable in terms of browser support.
@markalexander it is supported: https://forums.aws.amazon.com/ann.jspa?annID=6185
I am currently using one of those workarounds. But would be good to align chalice with the capabilities of the API Gateway.
Ah, ill mark as feature request.
Supported via #1214