Express server using external api cookies

Viewed 16

I have a react project that calls my api for displaying data. I want to access an external api that has a login endpoint and many different data endpoints. The login endpoint returns set cookie headers which include cookies with the domain set to the external domain. Every data endpoint requires the cookies to be sent.

What is the best strategy for taking the external cookies and saving them on the server or locally and then sending them back to the external api when I make a data call? Do I need to intercept the set cookie header from the external api response? How do I send cookies back to the external api from my api? How do I deal with the cookies having the domain of the external api?

0 Answers
Related