is it possible to get httpOnly cookies in getServerSideProps? #17677
-
I want to be able to set a
and then get that cookie in
Seems as though you cannot get |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 10 replies
-
You should be able to like this: export const getServerSideProps = async ctx => {
// get the cookies
const cookies = ctx.req.headers.cookie
// set the cookies
ctx.res.setHeader('Set-Cookie', 'foo=bar; HttpOnly');
return { props: { } };
}; |
Beta Was this translation helpful? Give feedback.
-
I have same problem, anyone helps me? |
Beta Was this translation helpful? Give feedback.
-
How is it possible for a |
Beta Was this translation helpful? Give feedback.
-
For clarification, I am able to access all cookies, including |
Beta Was this translation helpful? Give feedback.
-
Hi guys need help :) express api is hosted on azure web app |
Beta Was this translation helpful? Give feedback.
You should be able to like this: