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

168
Vistas
AWS Lambda and setting cookie

I have a problem with setting a cookie on the response from the lambda function.

There are two pages (uploaded on s3 bucket) - login and validate.

On my login page I do some calls to 3rd api and at the end of that I return a cookie.

{
  statusCode: 200,
  headers: {
    'Access-Control-Allow-Origin': 'HERE GOES DOMAIN WITH LOGIN.HTML AND VALIDATE.HTML FILES',
    'Access-Control-Allow-Credentials': true,
    'Access-Control-Allow-Headers': 'Content-Type,X-Amz-Date,X-Amz-Security-Token,Authorization,X-Api-Key,X-Requested-With,Accept,Access-Control-Allow-Methods,Access-Control-Allow-Origin,Access-Control-Allow-Headers',
    'Access-Control-Allow-Methods': 'GET,POST,PUT,DELETE,HEAD,OPTIONS',
    'Set-Cookie': "sess_id=key;Expires=SOME_VAL;Path=/"
  }
}

I do see that cookie in developers tool in response headers but its not getting set up for some reason. document.cookie result with empty string.

So I set that up manually but when I do another reqeust on my second page (validate) to API gateway (lambda for validating that session) the session is not included in the request headers.

I use fetch web api and credentials:"include" with each request but without any success.

Any tips? Thanks.

about 4 years ago · Juan Pablo Isaza
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