Using multiValueHeaders to return multiple cookies works in local development but not in production

Hi @coelmay

Thanks for the swift reply.

I did try:

  return {
    'statusCode': 200,
    'multiValueHeaders': {
      'Cache-Control': 'no-cache',
      'Set-Cookie': [sessionCookie, rbacCookie]
    },
    'body': JSON.stringify(body)
  }

However, that returns a 502 in production, but still works ok locally.

Wrapping all headers in an array, again works locally, but in production, although it does not return a 502, it still does not return the cookies.

  return {
    'statusCode': 200,
    'multiValueHeaders': {
      'Cache-Control': ['no-cache'], <<<<<< pass value in array
      'Set-Cookie': [sessionCookie, rbacCookie]
    },
    'body': JSON.stringify(body)
  }

I picked up in this post that @ekafyi resolved his issue using both headers and multiValueHeaders:

" multiValueHeaders can only contain the Set-Cookie property. Anything else goes in headers as usual."

Which or course I tried, but had not joy.

Thanks,

Paul