The following HTTPOnly cookie did is not available in getServerSideProps using Next JS:
The jid cookie is set by an Expressjs API located at the url https://api-dev.example.com
I am tried to get the cookie from an Next JS app located at the url https://localhost:3000.
In other words, the API is online but trying to get the cookie on localhost.
The getServerSideProps method used:
export const getServerSideProps = async (ctx) => {
console.log(ctx.req.headers.cookie);
return {
props: {},
};
};
Here is what is printed in the console:
_ga=GA1.1.1479601312.1604335288;
_gid=GA1.1.1556520191.1604335288;
_gat_gtag_...._1=1;
_nid=ey...Cn0drV6-ImMPY
The cookie printed all have a domain localhost and are not HTTPOnly.
Any insights?
