var express = require('express');
var cookieParser = require('cookie-parser');
var session = require('express-session');
var cors = require('cors')
var app = express();
app.use(cors())
app.use(cookieParser());
app.use(session({
secret: "thisismys",
saveUninitialized: true,
cookie: {
domain: 'localhost:4000',
sameSite: 'none',
secure: false,
maxAge: days
},
resave: true
}));
app.get('/', function(req, res){
if(req.session.page_views){
req.session.page_views++;
res.send("You visited this page " + req.session.page_views + " times");
} else {
req.session.page_views = 1;
res.send("Welcome to this page for the first time!");
}
});
app.listen(4022)
When I run Frontend and backend on localhost it working
But When I put this backend code on server and try to call from frontend it is always retune first time
I have already tried with credentials, sameSite all options
but nothing work for me
Your help would be great for me, Already opened issue on slack as well not reply received
When I run Frontend and backend on localhost it working
But When I put this backend code on server and try to call from frontend it is always retune first time
I have already tried with credentials, sameSite all options
but nothing work for me
Your help would be great for me, Already opened issue on slack as well not reply received