Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redis error: Error: Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED 127.0.0.1:6379 #5

Open
jenelynababan opened this issue Feb 17, 2017 · 1 comment

Comments

@jenelynababan
Copy link

jenelynababan commented Feb 17, 2017

When I checked my redis-server status , it says redis server is running but I got this error when I log
RedisClient.on('error', function(err) {
console.log('Redis error: ' + err);// Redis error: Error: Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
});
and when I try to console the req.session it returns undefined. any clue about this issue?
please help me I am new to this. thank you

heres my setup:
`var express = require('express');
var redis = require("redis");
var session = require('express-session');
var redisStore = require('connect-redis')(session);
var parser = require('body-parser');
var RedisClient= redis.createClient();

app.use(session({
secret: 'myseceret',
store: new redisStore({host: '127.0.0.1', port: 6379, client: client,ttl : 260}),
saveUninitialized: false,
resave: false,
cookie: { secure: true }
}));
client.on('error', function(err) {
console.log('Redis error: ' + err);
});
`

@strk
Copy link
Owner

strk commented Feb 17, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants