Questions tagged [connect-mongo]

89 questions
0
votes
0 answers

MongoError - caused by npm module connect-mongo

Im getting these errors MongoError: server instance pool was destroyed MongoError: Topology was destroyed i'd love if anyone would know what is causing this module to make these errors and how to fix it. . MongoError: server instance pool was…
Jonas N
  • 1
  • 1
0
votes
2 answers

TypeScript - Argument of type '{}' is not assignable to parameter of type '{}' - MongoStore

I'm relatively new to TS and I've have encountered a type problem in new MongoStore() parameters. Typically I can reuse the Native MongoDB connection by writing db: database as an argument in JS, but TS shows the following error: Argument of type…
0
votes
1 answer

In Express.js, how do I generate server-side sessions for logged in users only?mo

Currently, I'm using express-session: https://github.com/expressjs/session combined with connect-mongo: https://github.com/jdesboeufs/connect-mongo I use the boilerplate examples from the site, and I can successfully generate sessions for logged in…
Hoa
  • 17,944
  • 25
  • 66
  • 97
0
votes
1 answer

Mongodb connect-mongo session store multiple app on same db

I have two SailsJS apps that use connect-mongo to store sessions. They are connected to the same MongoDB database and the problem it's when I am connected to the first app, if I go on the second app I'm directly disconnected on the first app and…
0
votes
2 answers

Node.js SPA, how to delineate between handling sessions for individual site visits(page refreshes), and long-term site visits (browser open/close)

I'm making a SPA with login functionality. I enacted session handling with 'express-session' originally so that the user's mongoDB _id would be stored, and they could hit 'refresh' without being logged out, which worked perfectly well. From here, I…
0
votes
1 answer

Can I use connect-mongo without Mongoose?

I'd prefer to use another ORM or just the core MongoDb driver. How hard would it be to make this possible? I'm currently using Monk, which is a light wrapper on top of Mongoskin.
Tim Hardy
  • 1,470
  • 13
  • 29
0
votes
1 answer

How can i fetch particular session document by specific value in express session using connect mongo?

Am trying to fetch all session document based on user id so that i can redirect after they are successfully logged in any machine by storing the variable named like lastviewed and date in session document, Please guide me further am using…
0
votes
1 answer

MongoError: not authorized on (DB name) to execute command

I'm using Node.Js, Expressjs, mLab (to host my database) and mongoDB Im getting an error of not being Authorized on Streetinform(my DB name) to execute command. {listIndexes: "sessions", cursor: {}} this is the error. this is how I connect to my…
Sean Reyes
  • 601
  • 6
  • 16
0
votes
0 answers

Mongoose keeps trying to authenticate with wrong admin db even though it is specified

The initial connection to the database seems to authenticate fine with this: mongoose.connect('mongodb://user:pass@localhost/traderdb/?authSource=admin', { auth: { authdb: "admin" } }, function(e) { //other…
0
votes
0 answers

Nodejs/Express Session - Error: Can't set headers after they are sent

I am getting the below error while trying to use express session with a simple nodejs sample app. When "resave" is set to true the below error appears, however when the same is set to false, there is no error. GET / 304 13.380 ms - - Error: Can't…
user3868848
  • 123
  • 2
  • 10
0
votes
1 answer

My Node.js web app establishes new session every time I reopen the browser

Every time I close all the browser windows and then open the web app again, a new session is established, that means I have to authenticate again. For your reference, I use express@4.14.0 as the web application framework, express-session@1.14.1 +…
kitlee
  • 100
  • 8
0
votes
1 answer

Ended sessions are not being destroyed

My application is using connect-mongo, express-session, keystone and passport handling login and user sessions. However, when a session ends (user logs out or closing the browser window) the session is not removed from the MongoDB session…
ChrisRich
  • 6,698
  • 9
  • 37
  • 56
0
votes
1 answer

set-cookie field is present, however is not set in Resources/Application tab of the browser

I got a cookie being set in the response header, however my browser doesn't store the cookie. The front-/back-end components run on localhost:8080/8082 respectively. Using node v5+, express v4+ and tried both connect-mongo/connect-redis Chrome v.…
Nikolay Melnikov
  • 1,345
  • 14
  • 24
0
votes
1 answer

How to configure connect-mongo

I am using "connect-mongo" node module to store session data in mongodb. Below is my code related to configuring connect-mongo const cookieParser = require('cookie-parser'); app.use(cookieParser()); const session = require('express-session'); const…
refactor
  • 10,094
  • 21
  • 63
  • 96
0
votes
1 answer

ExpressJS / connect-mongo update session

I'm using connect-mongo to store PassportJS sessions. My conf in server.js is: app.use(session({ name: 'Example', secret:'exampleasd', saveUninitialized: false, resave: false, cookie: { maxAge: 1000*60*60*2 }, store: new…
mdv
  • 855
  • 3
  • 14
  • 25