The Problem:
- On first load, multiple API calls are made in parallel from different components.
- Since there’s no session cookie yet, the backend (Moqui) creates a new session for each request.
- This results in 4–5 separate sessions being created unnecessarily.
What I Need:
- A way to ensure that all initial requests share the same session, even before the user is authenticated.
- A recommended pattern (middleware, proxy, etc.) in Next.js to manage and persist the Moqui session cookie for guest users across multiple API calls.
Any suggestions or best practices to handle this cleanly would be greatly appreciated!