Hi! I’m hoping someone can point me to best practices in regards to API cookies, NextJS, and SSR.
What I’m encountering is that I’m calling an external API that is trying to set some cookies on the browser. This works when the call is made directly from the browser to the API. However, if the API call is made from the SSR function, then the cookie data never makes it to the browser.
In this way the cookie is thrown away and never sent for follow-up requests.
What is the best way to handle these API cookies when using SSR? Is there a way to have NextJS pass them back to the browser or remember them for subsequent calls. Any advice, links, or videos would be very helpful.
Sounds like you found a thing that needs to happen on the client side.