session icon indicating copy to clipboard operation
session copied to clipboard

Issue when setting maxAge = 'session'

Open vicb opened this issue 5 years ago • 0 comments

Everything is fine when I set maxAge to a number.

As soon as I set maxAge to "session" I get a REDIS error:

  ReplyError$1: ERR value is not an integer or out of range

I have launched my app with redis traces:

DEBUG=ioredis:* node app/server.js

And I see the error at this point:

  ioredis:redis write command[35.224.153.24:18918]: 0 -> setex('ee336b93-7195-4e06-9e66-dffedbda5466,session,{"grant":{"provider":"google","dynamic":{"x":"151","y":"26"},"state":"98709c21509fd43b0c2ec39071816bebaf0f4368","nonce":"9de36d71dfba5d70310464eee0c4f3a486 ... <REDACTED full-length="763">') +8s

This is how I setup the session:

app
  .use(
    session(
      {
        store: redisStore({
          host: redisUrl.hostname,
          port: Number(redisUrl.port),
          password: redisUrl.password,
        }),
        maxAge: 'session',
        key: 'flyxc.sess',
        httpOnly: true,
        signed: true,
        rolling: false,
        renew: false,
        secure: process.env.NODE_ENV != 'development',
      },
      app,
    ),
  )

Any clue what could go wrong or how to debug further ?

vicb avatar Oct 07 '20 00:10 vicb