Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

346
Vistas
axios doesn't store cookie but in response is setCookie=.... Access-Control-Allow-Credentials and withCredentials php - laravel

i wanna get passport cookie in react.js i fixed all of thing in .htaccess and i can get the cookie with javascript

but it isn't store in browser storage

 cookie is here but didn't store

this is my code in front with axios

.htaccess

  Header set Access-Control-Allow-Origin "http://localhost:3000"
 Header set Access-Control-Allow-Credentials  "true"
    Header set Access-Control-Allow-Headers "Access-Control-Allow-Credentials,Access-Control-Allow-Headers,Access-Control-Allow-Origin"
   

react.js

axios.get("http://domin.com/JwtCookie", {
        headers: {
            'Accept': 'application/json',
            'Content-Type': 'application/json',
        },

        withCredentials: true,
    }).then(re => console.log(re)).catch()

i try it with another cookie but there is this problem too

thanks ...

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

The CORS headers Access-Control-Allow-... are not request headers, they are response headers so you should set them on the response.

Also, you need to set the Samesite=None attribute on the cookie. After that, your cross-domain cookie will be sent by the browser.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda