【发布时间】:2022-12-27 19:42:10
【问题描述】:
we are calling https://demo.com/auth/session in next js application
backend team set the response cookie as secure HttpOnly cookie
const session = await (
await fetch(
`https://demo.com/auth/session`,
requestOptions
)).json();
console.log("cookies",ctx?.req?.headers?.cookie);
backend cookies code
Set-Cookie: id=a3fWa; Expires=Thu, 21 Oct 2021 07:28:00 GMT; Secure; HttpOnly
how can we access secure HttpOnly cookie in next js application
【问题讨论】:
-
Where in your Next.js app are you calling that endpoint, client-side or server-side?
-
calling end point at server-side..
标签: javascript reactjs cookies next.js httpcookie