Cookies are not being passed from the front end to the back end in production within the monorepo.
hellow guys, 
I'm facing an issue on production where cookies aren't being passed from
 my Next.js frontend (platform) to my Next.js backend (API) within a Turborepo monorepo setup on Vercel.  but working fine locally.
This setup uses a shared auth package with Better-Auth for authentication. The issue doesn't occur locally, and I've already tried several solutions without success.
What's causing this? I've checked the environment variables and CORS settings, and they appear to be correct.
What's causing this? Has anyone faced the same issue or has a solution?
project structure : 
apps/
  -platform
  -api
packages/
   -auth ( better-auth)
validation failing here. when i send req from FE to BE.
Solution:Jump to solution
Here's a summary of the issue i faced:
*   Vercel's default 
.vercel.app subdomains don't allow cross-origin cookie sharing.
*   This means subdomains like floxify-fe.vercel.app and floxify-be.vercel.app can't share cookies.
*   Cookie sharing works fine when using your own custom domain (e.g., floxify-fe.floxify.ai and floxify-be.floxify.ai)....1 Reply
Solution
Here's a summary of the issue i faced:
*   Vercel's default 
.vercel.app subdomains don't allow cross-origin cookie sharing.
*   This means subdomains like floxify-fe.vercel.app and floxify-be.vercel.app can't share cookies.
*   Cookie sharing works fine when using your own custom domain (e.g., floxify-fe.floxify.ai and floxify-be.floxify.ai).
*   i spent two days debugging this issue, even with the help of GitHub Copilot, i wasted 2 days with my 20% premium requests.
*   The key takeaway is to always test cookie sharing functionality with a custom domain to avoid this problem.
I'll sleep better tonight. Only got 4 hours as a solo builder, so I had to find a solution myself. Thanks.