There are three separate Set-Cookie in the response header. Each one of them has different key-value pairs in it.
However, when I do response.headers.get('Set-Cookie') that merges all three Set-Cookie values into one big string and I can’t parse them by ; anymore.
Please post a complete reproduction that one could run. Unfortunately there’s not much we can help with, because we don’t know what headers your url there returns.
I added this line in the response block:
console.log(JSON.stringify(response.headers));
and tested with a random JSON API. I see that the headers are just a plain object, and I do not think that JSON objects allow several properties have the same name. You’re likely mixing something up.
Please find it below. As you can see, there is only one “Set-Cookie” in the header and the values are merged. My-service and AWSELB should have separated by ; .
Have you tried debugging what cookie string your backend sends? Is the “merging” behaviour specific to Fuse, or does, for example, a browser receive the same?
And again, please provide a complete reproduction that we could run.