Note that there are some explanatory texts on larger screens.

plurals
  1. PONodejs + Passport.js + Redis: how to store sessions in Redis
    primarykey
    data
    text
    <p>I've read this topic <a href="https://stackoverflow.com/questions/10164312/node-js-express-js-passport-js-stay-authenticated-between-server-restart">Node.js + express.js + passport.js : stay authenticated between server restart</a> and I need exactly the same thing, but for Redis. I used such code:</p> <pre><code>var RedisStore = require('connect-redis')(express); app.use(express.session({ secret: "my secret", store: new RedisStore, cookie: { secure: true, maxAge:86400000 } })); </code></pre> <p>And it doesn't work. To connect Redis I use connect-redis module. What I'm doing wrong? Thanks!</p> <p><strong>UPD</strong>: I don't get any errors. To ensure auth processes succesfully, I added log-line, and it executes.</p> <pre><code>function(email, password, done) { // asynchronous verification, for effect... process.nextTick(function() { findByEmail(email, function(err, user) { if (!user) { return done(null, false, { message: 'Unknown user ' + email }); } if (user.password != password) { return done(null, false, { message: 'Invalid password' }); } //just logging that eveything seems fine console.log("STATUS: User " + email + " authentificated succesfully"); return done(null, user); }) }); })); </code></pre> <p>Log with express.logger() enabled was:</p> <pre><code>127.0.0.1 - - [Fri, 19 Oct 2012 05:49:09 GMT] "GET /ico/favicon.ico HTTP/1.1" 404 - "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.94 Safari/537.4" STATUS: User admin authentificated succesfully </code></pre> <p>I <strong>do</strong> suppose that there is nothing wrong with auth/users/credentials/serializing/deserializing itself. The problem is just passport cannot set cookie to Redis and the read it.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload