[bugs]:Header cookies will lost if do not defined getServerSideProps function in #17134
Unanswered
thinksource
asked this question in
Help
Replies: 0 comments
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.
-
Bug report
Describe the bug
The page without defined getServerSideProps function will lost the header props of request. espically, for my case, I lost the cookies
The getInitialProps do not keep headers, only getServerSideProps defined can keep headers.
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
2, Define cookies provider in _app.tsx
inside the MyApp.getInitialProps function I just inject cookie into pageProps, and in UserProvider, I use this cookie
no mater what you write inside, but if you component do not have getServersideProps function defined. it will lost the cookie.
I mean inside the request there still have cookie but my UserProvider get empty cookie.
Expected behavior
Not lose any cookies, even not function defined.
Screenshots
You can find my fixed:
https://github.com/thinksource/nwt/releases/tag/v0.2
the previous page /organization and /organization/add will not continue using cookies
System information
Beta Was this translation helpful? Give feedback.
All reactions