Response cookies not being set in browser #820
Unanswered
anirudhkhanna-oyo
asked this question in
Q&A
Replies: 1 comment
-
Without a minimal reproducible example there is little I can do. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Checks
http-proxy-middleware
.Describe the bug (be clear and concise)
Hi,
I'm using [email protected] to proxy requests to an endpoint where a website is hosted. Before this proxy happens, my application sets a few cookies (using the regular
res.cookie()
method). The proxied endpoint (the website application), also sets some response cookies.For eg.
Cookie set by my node app:
res.cookie('node_cookie', 'node')
Cookie set by the proxied website:
'web_cookie': 'web'
(somewhere in the website's JS)The issue I'm facing is that the cookies which my node app is trying to set are never reflected in the browser. Only the cookies coming in the proxied website's response are set.
Now after digging a bit, we've got these two objects,
proxyRes
andres
:Only the cookies present in
proxyRes
are being set, and the cookies from the currentres
object are ignored for some reason.Additionally, I noticed that the
res
cookies are getting set successfully whenproxyRes
has no Set-Cookie header.Step-by-step reproduction instructions
Expected behavior (be clear and concise)
Both sets of cookies should be set successfully.
How is http-proxy-middleware used in your project?
What http-proxy-middleware configuration are you using?
What OS/version and node/version are you seeing the problem?
Additional context (optional)
No response
Beta Was this translation helpful? Give feedback.
All reactions