Skip to content
New issue

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

koa-generic-session set error: Cannot read property 'maxAge' of undefined #14

Closed
sumaolin opened this issue May 30, 2016 · 6 comments
Closed

Comments

@sumaolin
Copy link

koa-generic-session set error: Cannot read property 'maxAge' of undefined
    at MongoStore.set$ (f:\Users\dev\bbs\node_modules\koa-generic-session-mongo\dist\store.js:195:33)
    at tryCatch (f:\Users\dev\bbs\node_modules\babel-runtime\regenerator\runtime.js:72:40)
    at GeneratorFunctionPrototype.invoke [as _invoke] (f:\Users\dev\bbs\node_modules\babel-runtime\regenerator\runtime.js:334:22)
    at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (f:\Users\dev\bbs\node_modules\babel-runtime\regenerator\runtime.js:105:21)
    at onFulfilled (f:\Users\dev\bbs\node_modules\co\index.js:65:19)
    at f:\Users\dev\bbs\node_modules\co\index.js:54:5
    at Object.co (f:\Users\dev\bbs\node_modules\co\index.js:50:10)
    at Object.toPromise (f:\Users\dev\bbs\node_modules\co\index.js:118:63)
    at next (f:\Users\dev\bbs\node_modules\co\index.js:99:29)
    at onFulfilled (f:\Users\dev\bbs\node_modules\co\index.js:69:7)
    at f:\Users\dev\bbs\node_modules\co\index.js:54:5
    at Object.co (f:\Users\dev\bbs\node_modules\co\index.js:50:10)
    at Object.toPromise (f:\Users\dev\bbs\node_modules\co\index.js:118:63)
    at next (f:\Users\dev\bbs\node_modules\co\index.js:99:29)
    at onFulfilled (f:\Users\dev\bbs\node_modules\co\index.js:69:7)
    at f:\Users\dev\bbs\node_modules\co\index.js:54:5

错误如上,相关的代码

app.use(session({
  store: new MongoStore(config.mongodb)
}));

是windows 7 下 node V4.4.3
koa-generic-session-mongo : v:0.0.25

@jurgob
Copy link

jurgob commented Nov 19, 2016

I have the same error using this store with koa-header-session

@attekei
Copy link

attekei commented Nov 27, 2016

Experiencing the same error too, in my case in conjunction with koa-session-minimal.

@jurgob
Copy link

jurgob commented Nov 28, 2016

I've fixed it with this pull request: 891d9a2

@yuu2lee4
Copy link

yuu2lee4 commented Nov 28, 2016

@jurgob maybe is #16

@lzztt
Copy link

lzztt commented Nov 28, 2016

@jurgob @yuu2lee4 got the same issue reported. I think the store's set interface need to be updated. Otherwise, the database records will have undefined TTLs.

The expected interface should be set(sid, sess, ttl): set session object for sid, with a ttl (in ms), for both koa-session-minimal and koa-generic-session.

@pavelvlasov
Copy link
Owner

thanks guys, interface is updated in 6115c41 (v0.3.0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants