I have a setup involving
Frontend server (Node.js, domain: localhost:3000) <---> Backend (Django, Ajax, domain: localhost:8000)
Browser <-- webapp <
If you want to allow all origins and keep credentials true, this worked for me:
app.use(cors({ origin: function(origin, callback){ return callback(null, true); }, optionsSuccessStatus: 200, credentials: true }));