
Research
/Security News
9 Malicious NuGet Packages Deliver Time-Delayed Destructive Payloads
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.
edu-connect-redis
Advanced tools
connect-redis is a Redis session store backed by node_redis, and is insanely fast :). Requires redis >= 2.0.0 for the SETEX command.
npm install connect-redis express-session
Pass the express-session store into connect-redis to create a RedisStore constructor.
var session = require('express-session');
var RedisStore = require('connect-redis')(session);
app.use(session({
store: new RedisStore(options),
secret: 'keyboard cat'
}));
A Redis client is required. An existing client can be passed directly using the client param or created for you using the host, port, or socket params.
client An existing clienthost Redis server hostnameport Redis server portnosocket Redis server unix_socketurl Redis server urlThe following additional params may be included:
ttl Redis session TTL (expiration) in seconds. Defaults to session.maxAge (if set), or one day.disableTTL Disables setting TTL, keys will stay in redis until evicted by other means (overides ttl)db Database index to use. Defaults to Redis's default (0).pass Password for Redis authenticationprefix Key prefix defaulting to "sess:"unref Set true to unref the Redis client. Warning: this is an experimental feature.serializer An object containing stringify and parse methods compatible with Javascript's JSON to override the serializer usedlogErrors Whether or not to log client errors. (default: false)
true, a default logging function (console.error) is provided.false, no logging occurs.Any options not included in this list will be passed to the redis createClient() method directly.
Clients other than node_redis will work if they support the same interface. Just pass the client instance as the client configuration option. Known supported clients include:
By default, the node_redis client will auto-reconnect when a connection is lost. But requests may come in during that time. In express, one way this scenario can be handled is including a "session check" after setting up a session (checking for the existence of req.session):
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
})
If you want to retry, here is another option.
MIT
FAQs
Redis session store for Connect
We found that edu-connect-redis demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.