Next-Router-State-Tree #86280
-
SummaryHow exactly does the A project I am working on will have different responses when the request is intercepted a value in Additional informationNo response ExampleNo response |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
|
Hi the Next-Router-State-Tree cookie is basically something Next.js uses internally to keep the client router state in sync with the server. It stores the current router tree so the server knows which parts of the page to re-render during navigation or RSC updates. It does not affect your app logic directly. As of now, this cookie cannot be disabled. If you need to make routing decisions, it is better to rely on the actual req.nextUrl or your own custom cookie instead of reading or modifying this internal one. |
Beta Was this translation helpful? Give feedback.
-
|
Hi zeaiter-squared, The How it is used on the server
Currently, Next.js does not provide a built-in option to fully disable the
|
Beta Was this translation helpful? Give feedback.
Hi zeaiter-squared,
No problem for miselading. Based on your description, the behavior you observed is consistent with how Next.js handles server-side rendering for dynamically generated pages.
When a field in the Next-Router-State-Tree is manipulated, the server will still render the page according to the current routing state. However, the server may include the user DTO in the HTTP response because it is required to render the profile page correctly. This does not indicate a security flaw, but rather reflects how server components and dynamic routing work in Next.js.
Sending the user DTO to the client in this case is expected for proper rendering and hydration. It is not intended as a …