Quantcast
Channel: Express creating new session for each request - Stack Overflow
Viewing all articles
Browse latest Browse all 3

Answer by enRaiser for Express creating new session for each request

$
0
0

why don't you use MongoStore to store session data? may be that will solve your problem.

 app.use(session({     secret: 'mysecret',     resave: false,     saveUninitialized: false,     expires: new Date(Date.now() + (60 * 60 * 24 * 7 * 1000)),     cookie: {  } ,     store: new MongoStore({mongooseConnection: mongoose.connection}) }));

Viewing all articles
Browse latest Browse all 3

Trending Articles





<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>