Your setup is correct on paper. The problem is that Safari blocks third-party cookies by default, and a cookie set by railway.app while you're on netlify.app is third-party no matter what SameSite says. Chrome is moving the same direction, so fixing it now saves you later.
Make the API same-site with the frontend:
- Option A: custom domain for both:
myapp.comfor the frontend,api.myapp.comfor Railway. Same site → first-party cookie. ThenSameSite=Laxworks too. - Option B: proxy the API through Netlify. In
netlify.toml:
[[redirects]]
from = "/api/*"
to = "https://myapi.up.railway.app/:splat"
status = 200Now the browser only talks to your Netlify domain and no CORS is needed at all.