I have to connect to two scripts on the same endpoint which does not support CORS. I now want to put small PHP script(s) on my own server which execute the HTTP requests server-side to circumvent the browser's CORS issue.
The first script takes a POST request (login) and returns session cookies and a JSON answer.
The second script takes a post request and the session cookies and returns a JSON answer.
I got this working for a POST request that does not require a session cookie, but it does not work where cookies are required. I don't find how I can process the cookie.
How can I get from PHP the cookie returned by the foreign server and process it? How can I send it again with the second request?