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

98
Views
How to access Cookie in the Frontend?

I'm using React on the Frontend and NestJS on the backend.

I've created a JWT token which i've attached to a cookie, the cookie is being sent to the client after client successfully register with the DB.

Using Postman I can see the mentioned cookie but don't know how to access it in the frontend.

See code below, Please advice.

FrontEnd

const requestFormSubmition = async () : Promise<any> => {
    const response = await axios.post('http://localhost:3006/auth/login', {
        ...formData
    },
    {
        headers : {
            "Access-Control-Allow-Headers": "Accept"
        }
    })
    // const allResponse = response.headers;
    console.log(response);
}

Backend

return response.cookie("Autorization-token", data.access_token).json();

Cors options on the backend

  const app = await NestFactory.create(AppModule, { cors: {
    "origin": "*",
    "methods": "GET,HEAD,PUT,PATCH,POST,DELETE",
    "exposedHeaders" : "*",
    "allowedHeaders": "*",
  }
  });
  
  app.use(cookieParser());

Postman result

enter image description here

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!