Hello,
Consider the snippet as shown in the documentation:
app.use(session( /* setup session here */ ))
app.use(function (req, res, next) {
if (!req.session) {
return next(new Error('oh no')) // handle error
}
next() // otherwise continue
})
When req.session is not available, I ping Redis and it's available. The problem is that the request has already gone through the middleware, so there's no way to recover. Would it be possible to include a function call in connect-redis to allow reloading the session manually? In other words, tell connect-redis to "try again". If we could obtain a session then, we could salvage the situation.
Once I get in this state, connect-redis never recovers. I get a !req.session on every single request... but Redis is working fine (I can access it without problems from terminal). Other than restarting the server (which sucks), is there a way to re-initialize connect-redis so that the next request can be properly initialized with a session?
We're using 1.4.7.
Hello,
Consider the snippet as shown in the documentation:
When
req.sessionis not available, I pingRedisand it's available. The problem is that the request has already gone through the middleware, so there's no way to recover. Would it be possible to include a function call inconnect-redisto allow reloading the session manually? In other words, tellconnect-redisto "try again". If we could obtain a session then, we could salvage the situation.Once I get in this state,
connect-redisnever recovers. I get a!req.sessionon every single request... butRedisis working fine (I can access it without problems from terminal). Other than restarting the server (which sucks), is there a way to re-initializeconnect-redisso that the next request can be properly initialized with a session?We're using
1.4.7.