Git Product home page Git Product logo

koa-generic-session-mongo's Issues

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

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

url and db are exclusive

Maybe worth noting in the docs that the url and db args are exclusive, even throw an error if both are provided. I had been using url: 'mongodb://127.0.0.1:27017', db: 'mydb' and getting admin db used, which was pretty unclear.

Connectionstring issues caused by _makeConnectionString method

Hi,

Inside dist/store.js the method _makeConnectionString does:

return 'mongodb://' + host + ':' + port + ')/' + db + '?ssl=' + ssl;

That right parenthesis messes up my connection string and I doubt that is something useful.
I think it should be removed.
(row 259)
Regards

can not authenticate

new MongoStore({
db: 'db',
collection: 'collection',
user: 'user',
password: 'password'
});

MongoError: Authentication failed.

"Cannot find module" error

Receiving the following error on application startup.

{ [Error: Cannot find module '../build/Release/bson'] code: 'MODULE_NOT_FOUND' }
js-bson: Failed to load c++ bson extension, using pure JS version

MongoDB Version: 3.0.3
koa version: 1.0.0
koa-generic-session version: 1.9.2
koa-generic-session-mongo-version: 0.2.2

const koa = require('koa');
const session = require('koa-generic-session');
const MongoStore = require('koa-generic-session-mongo');

const app = koa();
app.keys = ['keys', 'keyskeys'];

app.use(session({
  key: 'test.sid',
  store: new MongoStore()
}));

app.listen(3000);

Happy to provide more information as needed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.