Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

205
Views
Set cookie in axios not working on cross domain request

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.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!