Skip to content
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

Return multiple Set-Cookie headers #1205

Closed
dmicic opened this issue Aug 7, 2019 · 5 comments
Closed

Return multiple Set-Cookie headers #1205

dmicic opened this issue Aug 7, 2019 · 5 comments

Comments

@dmicic
Copy link

dmicic commented Aug 7, 2019

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?

@markalexander
Copy link

markalexander commented Aug 9, 2019

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.

@dmicic
Copy link
Author

dmicic commented Aug 9, 2019

@markalexander it is supported: https://forums.aws.amazon.com/ann.jspa?annID=6185

@dmicic
Copy link
Author

dmicic commented Aug 9, 2019

I am currently using one of those workarounds. But would be good to align chalice with the capabilities of the API Gateway.

@stealthycoin
Copy link
Contributor

Ah, ill mark as feature request.

@jamesls
Copy link
Member

jamesls commented Sep 26, 2019

Supported via #1214

@jamesls jamesls closed this as completed Sep 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants