Chalice: Return multiple Set-Cookie headers

Created on 7 Aug 2019  路  5Comments  路  Source: aws/chalice

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?

feature-request

All 5 comments

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

michaeldimchuk picture michaeldimchuk  路  3Comments

calz1 picture calz1  路  3Comments

kortina picture kortina  路  3Comments

jarretraim picture jarretraim  路  3Comments

stannie picture stannie  路  4Comments