Answer the question
In order to leave comments, you need to log in
Why doesn't Axios send a Cookie?
My React js SPA is at localhost:3000 backed by api.f-mania (rest api php).
In React js I use axios credentials inserted true:
axios.interceptors.request.use((config) => {
config.withCredentials = true;
return config;
});
// Headers
header('Access-Control-Allow-Origin: http://localhost:3000');
header('Access-Control-Allow-Credentials: true');
header('Access-Control-Allow-Methods: GET, POST, PUT, DELETE');
header('Access-Control-Allow-Headers: *');
header('Content-Type: application/json');
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question