i have a simple react client with axios on localhost , on other side i have python fastapi in the server side ( both https) . server side is setting a none httponly cookie , clientside receive it but won't set it . here is my response:
access-control-allow-credentials
true
access-control-allow-origin
https://localhost
access-control-expose-headers
set-cookie
content-length
52
content-type
application/json
date
Sun, 19 Sep 2021 12:46:09 GMT
server
uvicorn
set-cookie
fakesession=fake-cookie-session-value; Max-Age=100000000; Path=/; SameSite=none; Secure
vary
Origin
here is my client side code :
export const AxTest = axios.create({
//baseURL: "https://localhost:6069",
baseURL: "https://***.***.***.***:3002",
headers: {
"Content-type": "application/json"
},
withCredentials: true,
});
cookie is not set , i don't receive any error and the response code is 200. document.cookie is empty . by the way i have tried both on my localhost ( python and react running on localhost ) it was setting cookie successfully.