Questions tagged [connect-redis]
15 questions
5
votes
2 answers
Nodejs: Express + RedisStore, req.session undefined
I have done this before... I don't follow what I'm doing wrong this time, but I've been struggling for a couple of hours and now consider myself mentally blocked. The corresponding…

Mamsaac
- 6,173
- 3
- 21
- 30
4
votes
2 answers
How to config Redis as session storage with KrakenJS
With Express, I can use Redis as session storage like this:
var express = require('express');
var app = express();
var RedisStore = require('connect-redis')(express);
app.use(express.cookieParser());
app.use(express.session({
store: new…

Linh Tran
- 95
- 8
1
vote
1 answer
External database with redis-connect?
I'm trying to connect to a 3rd party Redis database with connect-redis. Any idea what's wrong?
app.use(express.session({ store: new RedisStore({host: keys.redis.url, port: keys.redis.port, db: keys.redis.db, pass: keys.redis.pass}), secret:…

Patrick
- 7,903
- 11
- 52
- 87
1
vote
0 answers
Error in express app when using Connect-redis to store session data "Type Error Client.get is not a function"
I'm quite new to using express. I'm using express, react, and mongodb to create a full stack app. When storing the sessionID on the Express server, I'm using a redis store with the "redis" and "connect-redis" packages.
For the most part this…

bigbossbhris
- 11
- 2
1
vote
0 answers
How to solve 'connect-redis' error 'A client must be directly provided to the RedisStore'
During the maintenance process, of a NodeJS backend application, I updated the connect-redis package to the last version 6.1.3 and bumped in the following error
Error: A client must be directly provided to the RedisStore
I tried to check online but…

Jakub
- 2,367
- 6
- 31
- 82
0
votes
0 answers
require("connect-redis")(session); require(...) is not a function
I was building a real-time chat app. I am using express-session to add cookies so that users don't have to login every time page refreshes.
const session = require("express-session");
const Redis = require("ioredis");
const RedisStore =…

Nabil Ahmed
- 21
- 4
0
votes
5 answers
Express, error - connectRedis is not a function - Solved the problem by installing connect-redis version 6 instead of 7
Ubuntu Mate 22.04.2 lts
Node 18.16.0
Redis 7.0.11 - without password (no auth), ping-pong test passes
"body-parser": "^1.20.2"
"connect-redis": "^7.1.0"
"cors": "^2.8.5"
"dotenv": "^16.3.1"
"express": "^4.18.2"
"express-session": "^1.17.3"
"redis":…

Doleensk
- 1
- 1
0
votes
0 answers
connect-redis upgrade to v7 from v6 is throwing error "redis is not a function"
connect-redis is throwing the below error after upgrading to v7. The code works perfectly fine in v6.x.x . Can you please suggest what needs to be modified or what I am missing here? Couldn't exactly find details on what has suddenly changed in v7…
0
votes
0 answers
How to do express-session with redis without using connect-redis
When I use legacyMode: true
const client = const client = redis.createClient({ legacyMode: true });
The session is working fine, but my other queries fail. So I don't want to use legacyMode there any new way to connect express-session store with…

Mani Sai Prasad
- 1
- 2
0
votes
0 answers
express session with connect-redis does not fail when redis is full
I'm using express-session "^1.17.1" and connect-redis "^4.0.4", hosted on Heroku using heroku-redis.
As I write this, the redis memory is full due to a misconfiguration on the maxmemory-policy, which is currently set to noeviction, which means that…

Pablo Gonzalez
- 1,710
- 3
- 21
- 36
0
votes
2 answers
Hosting Redis on EC2 - ConnectionTimeoutError
I have an EC2 instance behind a load balancer. The security group attached to it allows for inbound connections (both ipv4 and ipv6 on port 6379). I am able to connect to my redis client:
redis-cli -h ec2-**-**-**-*.us-west-1.compute.amazonaws.com…

AlexDev
- 35
- 6
0
votes
0 answers
Setting different session prefix per user in express-session with connect-redis
Using latest version of node, express, express-session and connect-redis.
I'm trying to achieve a bit more control over sessions of other users from the backend.
For example, I'd like to change/delete a specific user's session without them making a…

LAZ
- 402
- 4
- 15
0
votes
1 answer
TypeScript: Type 'RedisClientType<...' is not assignable to type 'RedisClient | Redis | Cluster | undefined'
I'm trying to use connect-redis and express-session for session management and I'm getting an error when passing in my Redis client.
Here is the code:
const app = express();
const RedisStore = connectRedis(session);
let redisClient =…

Trentwt
- 15
- 6
0
votes
1 answer
express session and connect redis error on saving session redis store (TypeError: this.client.set is not a function)
I am trying to implement express-session and connect-redis to manage session for my node application.
I already follow instructions on how to apply the express-session with connect-redis
app.js
import express from "express";
import http from…

Oli Soproni B.
- 2,774
- 3
- 22
- 47
0
votes
1 answer
Redis connection close
Im using connect-domain and connect-redis. Below code checks for redis cache in Redis database.
function redis_get(key, req, res) {
var redisClient = redis.createClient();
redisClient.get(redisKey, function (err, data) {
if (err) {
…

user87267867
- 1,409
- 3
- 18
- 25