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.
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.