How I can reuse session from SSR because in client side I can not access to cookie. Can someone guide me for best practice, Thank you! I use server action to login and create session cookie const session = await login(email, password)
if (session) {
cookies().set(SESSION_COOKIE, session.secret, {
path: '/',
httpOnly: true,
sameSite: 'lax',
secure: true,
}) and I want to use createJWT on client side to pass to my backend and use it for backend API calls
TL;DR
Developers seek guidance on reusing session from SSR in Next.js 14 mixing SSR and CSR. They are looking for best practices since the client side cannot access cookies directly. The solution involves creating a JWT on the client side to pass to the backend for API calls after setting the session cookie in the server.