Answer the question
In order to leave comments, you need to log in
How to save cookies on the Node.js server transmitted via API from the server to php?
I can not immediately paint everything correctly, so write I will supplement the question as fully as possible.
Input data. There are:
1. API in PHP.
2. Server on Node.js
3. Client side on React.js
My actions and where the error occurs:
1. First I need to get a CSRF token. I get it on the Node.js server, along with all the data:
server:Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips mod_fcgid/2.3.9 PHP/7.3.0
strict-transport-security:max-age=31536000; preload
x-powered-by:PHP/7.3.0
expires:Thu, 19 Nov 1981 08:52:00 GMT
cache-control:no-store, no-cache, must-revalidate
pragma:no-cache
access-control-allow-headers:Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With
access-control-allow-methods:GET,HEAD,POST,PUT,DELETE,OPTIONS
access-control-allow-credentials:true
content-type:application/json
date:Fri, 05 Jul 2019 11:26:37 GMT
content-length:103
connection:keep-alive
set-cookie:PHPSESSID=907f9cace36ee999fea00c736f4367b1; path=/,cookie_hash=KaY3uShg25OUQVnTxyva2w6LLosuBT4K; expires=Thu, 31-Dec-2037 23:00:00 GMT; Max-Age=583587203; path=/
Answer the question
In order to leave comments, you need to log in
You have two different servers. It is logical to use something more universal for the exchange. For example, jwt tokens
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question