Axios не будет отправлять cookie, Ajax (xhrFields) отлично работает

Использование Axios

export function sendAll() {
  return (dispatch) => {
    dispatch(requestData());
    return axios({
      method: 'POST',
      url: `${C.API_SERVER.BASEURL}/notification/sendAll`,
      data: {prop: 'val'},
      // responseType: 'json',
      headers: {
        'Content-Type': 'application/json'
      },
      withCredentials: true
    }).then((response) => {
      dispatch(receiveData(response));
    }).catch((response) => {
      dispatch(receiveError(response));
      // dispatch(pushState(null, '/error'));
    })
  }
};

Результат с использованием Axios

Использование $ .ajax

$.ajax({
  url: " http://local.example.com:3001/api/notification/sendAll",
  method: "post",
  data: {},
  crossDomain: true,
  xhrFields: {
    withCredentials: true
  }
})

Результат с использованием $ .ajax

Я не могу заставить Axios отправлять POST при попытке прикрепить данные к POST (cookie не отправляется в любом случае). Настройка моего сервера (экспресс):

app.use(function (req, res, next) {
  res.header("Access-Control-Allow-Origin", `${C.PROTOCOL}://${C.DOMAIN}:${C.PORT}`);
  res.header("Access-Control-Request-Headers", "*");
  res.header('Access-Control-Allow-Methods', 'GET, POST, DELETE, OPTIONS');
  res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept, Authorization");
  res.header("Access-Control-Allow-Credentials", "true");
  next();
});

У меня не определен маршрут OPTIONS. Я хочу, чтобы Аксиос отправил POST с cookie.

router.post('/notification/sendAll', function (req, res, next) {
  res.sendStatus(204);
  // ...
});

Ответы на вопрос(2)

Ваш ответ на вопрос