We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
我的session配置了maxAge=60000,60秒。
maxAge=60000
app.use(session({ name:'jsessionids', store: new redisStore({ host:config.redis.host, port:config.redis.port, pass : config.redis.password, db: config.redis.database }), cookie: {maxAge: 60000}, //milli resave: false, // don't save session if unmodified saveUninitialized: false, // don't create session until something stored secret: 'yueai_muzhi' }));
但是我发现, 在node_modules/connect-redis/lib/connect-redis.js里,getTTL方法会把我的时间改为1天。
node_modules/connect-redis/lib/connect-redis.js
getTTL
function getTTL(store, sess) { debug('getTTL', store, session.cookie); //我在这打印了日志 var maxAge = sess.cookie.maxAge; return store.ttl || (typeof maxAge === 'number' ? Math.floor(maxAge / 1000) : oneDay); }
打印出来的结果是
connect:redis getTTL +28ms undefined { originalMaxAge: 60000, expires: '2016-04-20T02:36:42.376Z', httpOnly: true, path: '/' }
cookie里没有maxAge,有的是originalMaxAge。 请问你们是怎样处理session的?
cookie
maxAge
originalMaxAge
The text was updated successfully, but these errors were encountered:
No branches or pull requests
我的session配置了
maxAge=60000
,60秒。但是我发现,
在
node_modules/connect-redis/lib/connect-redis.js
里,getTTL
方法会把我的时间改为1天。打印出来的结果是
cookie
里没有maxAge
,有的是originalMaxAge
。请问你们是怎样处理session的?
The text was updated successfully, but these errors were encountered: