My server is receiving different X-XSRF-TOKEN headers compared to the cookies being sent when I make requests 2-3 times per second using axios.
let axiosInstance = axios.create({
baseUrl: "MY_BASE_URL_HERE",
timeout: 20000
});
function sendRequest() {
if (data) {
if (axiosInstance) {
axiosInstance
.post("MY_API_HERE", CryptojsEncrypt(data))
.then((res) => {
console.log("success");
})
.catch((err) => {
console.log('error');
});
}
}
}
https://i.sstatic.net/di5Qe.png
I need assistance in ensuring that my requests are sent with consistent cookie values and headers each time.
I attempted to use interceptors and transformRequest to compare the header with the cookie values, and abort the request if they do not match. However, this approach did not work for me. I simply want my requests to have the same headers and cookie values every time they are sent.