Site works great when backend and frontend are deployed locally (on two different ports) but cookies won't send when I run it on Vercel. I even tried running the front-end locally using the back-end that I deployed on Vercel and the request still didn't contain cookies.
This is what the request looks like using the local backend: enter image description here
And with the Vercel-deployed backend: enter image description here
My vercel.json file looks like this:
{
"version": 2,
"builds": [
{
"src": "*.js",
"use": "@vercel/node"
}
],
"routes": [
{
"src": "/(.*)",
"dest": "/",
"methods": ["GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS"],
"headers": {
"Access-Control-Allow-Credentials": "true",
"Access-Control-Allow-Origin": "http://localhost:3000",
"Access-Control-Allow-Methods": "GET,OPTIONS,PATCH,DELETE,POST,PUT",
"Access-Control-Allow-Headers": "*"
}
}
]
}
And I've configured axios to use credentials and set credentials to true in the Express index.js file. And, set-cookie works:
Would appreciate any help.
I've tried changing the headers a bunch and no combination seems to work.