Closed xiaoshuimao closed 6 years ago
Translation of this issue:
Config.session = {
//maxAge: 10 * 60 * 1000 , // ms
maxAge: 'session',
Key: 'EGG_SESS',
httpOnly: true,
Encrypt: true,
}
I have no effect in this setting. Do you need other ways to achieve it?
就是这么设置 maxAge: 'session'
,给个能稳定复现的 repo
貌似是已知 bug : https://github.com/koajs/session/issues/133
@whxaxes 感谢
看了一下代码,看到 @dead-horse 当初做了这个更改 https://github.com/koajs/session/commit/b976b10212f522b675711badb7ce1bc9a909d19d ,改成了每次实例化的 context session 实例用的都是同个 opts,而在 https://github.com/koajs/session/blob/master/lib/context.js#L293 中又对 maxAge 做了更改,当 maxAge 为 session 的时候就把 opts.maxAge 改成了 undefined,就导致了这个问题 .... @dead-horse 是否得改回 assign 去?
@whxaxes 👍 可以提个 PR
@dead-horse 提了:https://github.com/koajs/session/pull/136
我这样设置并没有效果, 需要其他方式来实现么?