Multiple `Set-Cookie` headers cause netlify lambda to throw an error

FYI, I just received such message from support of Netlify:

Hi Jack,

Sorry to say there isn’t a workaround for this at the moment. We aren’t using AWS API gateway, we’re using our own. Right now there isn’t a way to return multiple set-cookie headers from a serverless function.

Gerald from Netlify

Which is quite terrible information… aws lambda allows to send multiple Set-Cookie headers with workaround like this implementation for multiple working set-cookie headers by panva · Pull Request #16 · dougmoscrop/serverless-http · GitHub , but it seems like there is no workaround for Netlify lambdas at the moment.

If anybody finds a way to send multiple cookies in one lambda response, let us know here!

1 Like