Skip to content

Issue when setting maxAge = 'session' #203

Description

@vicb

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 ?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions