Skip to content

Creating a replica of redis session store #1655

Open
@williamdarkocode

Description

@williamdarkocode

When used as a session store in an expressjs/nodejs app as such:

var express = require("express");
var session = require('express-session');
var redis = require("redis");
var redisStore = require('connect-redis')(session);
var redisClient = redis.createClient();
// more dependencies are loaded here...

app.use(session({
secret: 'mysecret',
// create new redis store.
store: new redisStore({ host: 'localhost', port: 6379, client: redisClient }),
saveUninitialized: false,
resave: false
}));

is there a way to create a replica of redisStore with the session data as the initial store. Are there any PubSub events when ever a new session is added, or removed from the store? I was thinking of using pubsub, and having two separate redis session stores, where one publishes to the other. Is this possible, is it the best solution?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions