You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By default the rendr server side is creating a new session every time it is doing stuff. Every visit or hard page refresh. This of course isn't really nice especially if you store it in a database for example because the a lot of unnecessary sessions are stored.
varsessionMiddleware=session({secret: config.server.session.secret,cookie: {maxAge: 24*60*60*1000*14},secure: true,store: newMongoStore({mongooseConnection: mongoose.connection}),resave: false,saveUninitialized: false});// Do not make a session when its the server or when it is a botapp.use(functionuseSession(req,res,next){varuserAgent=req.headers['user-agent'],isBot=(/bot|googlebot|crawler|spider|robot|crawling/i.test(userAgent)),isServer=(userAgent=="Rendr RestAdapter; Node.js");if(!isBot&&!isServer){returnsessionMiddleware(req,res,next)}next()});
The text was updated successfully, but these errors were encountered:
Shouldn't the middleware see the session cookie when the client app is communicating to the server and not create a new session? Or am I missing something?
I think this is worth sharing.
By default the rendr server side is creating a new session every time it is doing stuff. Every visit or hard page refresh. This of course isn't really nice especially if you store it in a database for example because the a lot of unnecessary sessions are stored.
The text was updated successfully, but these errors were encountered: