I am using lite server by John Papa with HTTP proxy middleware by chimurai as a dev server. the problem is with my session cookie, I cannot persist the session cookie that comes
In my case setting "cookieDomainRewrite": "localhost",
works. This allows the browser to setup correctly the cookies since the domain would match
Below complete config for setupProxy.js
in React:
const {createProxyMiddleware} = require('http-proxy-middleware');
module.exports = function (app) {
app.use(
'/api',
createProxyMiddleware({
target: 'http://localhost:8000',
changeOrigin: true,
cookieDomainRewrite: "localhost",
})
);
};