Using Session in Server Rendered Pages with Next.js 14 #64988
Unanswered
aashi0001
asked this question in
App Router
Replies: 1 comment
-
Hi 👋
You can continue using the Pages Router and If you want to switch to App Router, you can get a session directly in a server component with |
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
-
Question:
With the removal of server-side props in Next.js 14, developers who relied on them for accessing session data in server-rendered pages are facing challenges. In Next.js 13, server-side props provided a straightforward way to pass context or access the request/response cycle to retrieve session data. How can we achieve the same functionality in Next.js 14 since server-side props are removed ? Are there alternative approaches or best practices for managing session data in server-rendered pages in the latest version of Next.js?
Code Example:
Looking forward to hearing your insights and experiences with this!
Beta Was this translation helpful? Give feedback.
All reactions