0

I'm trying to send multiple Set-Cookie headers via a AWS Lambda Function integrated with an HTTP API from API Gateway but I cant manage to do that in a non-trash way.

https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html

The documented way form official documentation doesnt seems to work

If i send two ore more Set-Cookie inside "headers", only the last one is actually sent

If i send an "headers" with one Set-Cookie with an array of values, one for each cookie, the fetch results in 500 - Internal Server Error, but the lambda logs dont show any error

If i send an "cookie" with an array of strings as values for cookies, as shown in the documentation, it also doesnt work

I've read that some people manage to do that by using different Set-Cookie upper-case and lower-case variations, but i wish i could avoid bad "work arounds" like this, so I didnt even tried.

2
  • Using "Set-Cookie" and "SET-COOKIE" response headers is definitely not great, but it appears to work. It's a shame that AWS do not let you mix REST (v1) and HTTP (v2) APIs on the same custom domain, since REST APIs allow duplicate headers, but HTTP APIs do not. Commented Apr 10, 2024 at 8:00
  • How did you fix this issue? Commented Dec 3, 2024 at 22:18

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.