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

164
Views
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
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!