cookie is not set on cross domain request. my server is running in localhost:8000 and client side running in localhost:9000. cors settings on the server nodejs/express is
app.use(function(req, res, next) {
console.log(req.method);
res.header("Access-Control-Allow-Origin", "*");
res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE,OPTIONS');
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept, Cache-Control, Authorisation");
if (req.method === 'OPTIONS') {
return res.send(200);
} else {
return next();
}});
Angualarjs is used in client side and the cors configuration is
SelappsAdmin.config(['$httpProvider', function($httpProvider) {
$httpProvider.defaults.useXDomain = true;
delete $httpProvider.defaults.headers.common['X-Requested-With'];
}])