Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

206
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda