Questions tagged [connect-mongo]

100 questions
11
votes
4 answers

Error: Connection strategy not found MongoDB

here is a simple connection to use express session store, it keeps banging out this error even though the text is right from the book. I am pretty sure is has something to do with 'new MongoStore' object initialization. var express =…
Spencer Hire
  • 735
  • 3
  • 14
  • 32
6
votes
8 answers

Error: Cannot init client | mongo-connect express-session

I am getting error while trying to save session on mongodb. Here is my code.. const express = require("express"); const session = require("express-session"); const MongoStore = require("connect-mongo").default; const app = express(); let…
Irfan Habib
  • 148
  • 1
  • 1
  • 8
5
votes
1 answer

session storage using node js and "connect-mongostore"

I am trying to create a session using node js with "connect-mongostore" module. I am able to create the session. But it is not storing it correctly. This is my server side code //loading all the dependencies var express = require('express'); var…
3
votes
1 answer

Alternative to Sails Mongo Adapter to support MongoDB 5.0 & 6.0?

Any alternatives to sails-mongo adapter? According to Sails-Mongo Compatibility, sails-mongo only supports up to MongoDB 4.2. Current issue I face is the below: error: Sending 500 ("Server Error") response: MongoError: Unsupported OP_QUERY command:…
E. Oregel
  • 321
  • 2
  • 4
  • 15
3
votes
2 answers

Cookies not storing in browser when using Passport with Express

I'm using passport-discord and passport to allow users to authenticate using their discord accounts. For some reason, cookies aren't being stored in the browser (on frontend website), I use axios (withCredentials set to true in request options) to…
FC5570
  • 163
  • 4
  • 12
3
votes
0 answers

Connect-mongo package with Jest leads to error "Jest did not exit one second after the test run has completed"

I built a middleware for session-based authentication with express-session package and as a session store I use the connect-mongo package. When I run this Jest test: //.. const createServer = require("./server") // <-- this line triggers the…
elMeroMero
  • 752
  • 6
  • 18
3
votes
1 answer

Express Session and Amazon Beanstalk with health check

I have a problem with express session, connect-mongo and Amazon Beanstalk. Each time that Amazon Beanstalk wants to check health, It's doing a request to API but it creates a new document in mongodb database. So, in a short time Amazon creates…
saeta
  • 4,048
  • 2
  • 31
  • 48
3
votes
4 answers

connect-mongo creating new session every second

I have my nodejs app hosted on Openshift. Here are my specs: node v0.10.35, express v3.4.8 My package.json dependencies: "dependencies": { "angular-loading-bar": "^0.9.0", "async": "^2.0.0-rc.5", "bcrypt-nodejs": "0.0.3", "body-parser":…
thethakuri
  • 509
  • 5
  • 16
2
votes
1 answer

Error: Cannot init client. Please provide correct options

Below is my server.js file.I read documentation of connect-mongo and tried all but did not resolve my issue. I use mongodb compass and removed the connection code because they don't allowed me to insert extra code. Please help me const app =…
2
votes
0 answers

Trouble connecting to local mongo db since updating to mongoose 5.x

I've checked around Stack and the Mongoose docs for this, but I can't seem to get it right. As implied in the title everything was fine until i upgraded the packages for mongoose and connect-mongo. Here's my database.js: var mongoose =…
agursky
  • 43
  • 5
2
votes
0 answers

mongoose: How can you access session model?

I use express-session package to handle sessions in express. I store sessions in mongodb using mongoose and connect-mongo for express-session store. I am trying to delete some items from my collection when session that was created by express-session…
kmeshavkin
  • 325
  • 1
  • 2
  • 12
2
votes
0 answers

How to handle all error using connect-mongo in expressjs

I am using below code for session management but not able to catch errors like: mongo authentication error. However, I am using error middle ware as well. var express = require('express'); var session = require('express-session'); var MongoStore =…
Sonu Singh
  • 191
  • 8
2
votes
0 answers

Connect mongo shows single entry for user session

Whats happening :- I am using connect-mongo to store user session. As far as I read, we can store multiple user session in db as long as server is not restarted(?). I have a login page and whenever user logs in I store email address in session. I…
user2714823
  • 607
  • 5
  • 15
  • 29
2
votes
1 answer

Connect-mongo Syntax Error: unexpected token =>

Hi I have the following error node_modules/connect-mongo/src/index.js:29 unserialize: options.unserialize || (x => x), ^^ I have these versions: node@v3.3.1 express@4.14.0 mongoose@4.6.5 mongodb@2.2.11
Alireza Ghaffari
  • 1,004
  • 3
  • 11
  • 24
2
votes
2 answers

Pairing sails, passport and mongo: error: A hook (`session`) failed to load! Object .... has no method 'assign'

I'm new to Sails/Node.js, so please be patient :) I'm trying to set up Sails 0.11.3 to work with google auth via Passport. It worked quite well (google auth worked) until I tried to enable mongo session storage. Once I've added into…
1
2 3 4 5 6 7