How to get cookies on client side? #6425
Unanswered
dramounlong3
asked this question in
Q&A
Replies: 1 comment 2 replies
-
Hey @dramounlong3 - You may have more luck finding an answer to your issue in our Discord community! You can join here: https://discord.gg/69YVBDft |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all, I am a beginner on react and node.js.


I create an express server on port 8000 by node.js template and create a react server on port 3000 in the same codesandbox.
When I send a "GET" request to server, the server will set a cookie and response to client.
Although cookie can be seen on edge browser's response header content (check on borwser network), I can't use the pagckage of universal-cookie to get cookie on client.
Client side can't find the cookie name "context" after print all cookies on console.
(I already use "cors" package and setup relative infromation on client and server side.)
I already try a lot of way to generate a cookie on express server but still can't get cookie on client. Whether the cookie is blocked by something means this way is impossible or my setup is incorrect? Does anyone can help me and I would appreciate a lot.
Here is my test code on a react component: or link
And here is one of router on server side: or link
Beta Was this translation helpful? Give feedback.
All reactions