How to use client side cookies when calling a separate backend
Unanswered
Labib posted this in #help-forum
LabibOP
Hello. In my crrent project I have a separate express backend with next. For authentication, I am sending back some cookies from the server.
In nextjs, I noticed if I make the API call in a server action with axios, the cookies dont get stored or sent. Even with the withCredential option set to true in axios. Also it turns almost every page into a dynamic function.
How can I use axios and make external API calls just like how I would in a normal react app where the cookies will be set and included automatically?
In nextjs, I noticed if I make the API call in a server action with axios, the cookies dont get stored or sent. Even with the withCredential option set to true in axios. Also it turns almost every page into a dynamic function.
How can I use axios and make external API calls just like how I would in a normal react app where the cookies will be set and included automatically?