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

845
Views
Can i Access items that i set in Response Object through Request Object in express js?

I have this code

res.cookie("jid", token, {
httpOnly: false,
path: "/",
  });
console.log("cookee is : ",res.cookie.name);// cokkie name not accessible
console.log("cookee is : ",req.cookies); // here it is accessible

So i am surprised that i set cookiee in res object but i was not able to access it throuhg res object but i was able to access it throug req object.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You can find the source code for res.cookie() here.

You can see that in the end, it calls this.append('Set-Header', ...), which adds a header to the response.

The Express response inherits from Node's ServerResponse, so the API to access the headers set on a response is res.getHeader().

So:

res.cookie("jid", ...);
console.log(res.getHeader('set-cookie'));

may do part of what you want here.

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