I am changing the settings in various ways It's failing
back/index.js
if (prod) {
app.use(hpp());
app.use(helmet());
app.use(morgan('combined'));
app.use(cors({
origin: /api.nodebird\.com$/,
credentials: true,
}));
} else {
app.use(morgan('dev'));
app.use(cors({
origin: true,
credentials: true,
}));
}
app.use(cookieParser(process.env.COOKIE_SECRET));
app.use(expressSession({
resave: false,
saveUninitialized: false,
secret: process.env.COOKIE_SECRET,
cookie: {
httpOnly: true,
secure: false, // https를 쓸 때 true
domain: prod && '.terecal-nodebird.com',
// domain: prod && '.terecal-nodebird.com',
},
name: 'rnbck',
}));
front/server.js
server.use(expressSession({
resave: false,
saveUninitialized: false,
// secret: '',
secret: process.env.COOKIE_SECRET,
cookie: {
httpOnly: true,
secure: false,
},
}));
Why does it work fine on my local server but not on Amazon servers?
And in local environment, if I request to localhost: 3060, login is maintained, but at 127.0.0.1:3060, login is not maintained
Maybe it has something to do with this?
If you know, please let me know Thank you