I tried copying concatSetCookieHeaders from remix but that... eh, doesn't work... Doing that I end up with a single set-cookie header.
Here's the relevant code:
const sessionIdCookie = await getUserSessionCookieFromMagicLink(request)
if (sessionIdCookie) {
const destroyCookie = await loginInfoSession.destroy()
return redirect('/me', {
headers: {
'Set-Cookie': concatSetCookieHeaders(destroyCookie, sessionIdCookie),
},
})
}
What I need is two Set-Cookie headers, and this gives me a single Set-Cookie header that doesn't end up updating either one.
If I use either of these cookie values by itself then they each work as expected. But I need to set them both in the same response.