Questions tagged [connect-mongo]
100 questions
1
vote
1 answer
Error: no open connections at Db._executeQueryCommand Node.js
I have a node application used with express framework. This application runs smoothly. But suddenly, after some point of time, it starts to give error as
"Error: no open connections at Db._executeQueryCommand"
From the description of above error, I…

gehlotparesh
- 142
- 3
- 13
1
vote
1 answer
Single Sign On for multiple Kraken JS applications
I have two Kraken JS applications running with connect-mongo as middleware for session storage, on two subdomains like one.example.com and two.example.com.
Both are protected by user login.
How could I implement a SSO feature to my apps?
Maybe…

maephisto
- 4,952
- 11
- 53
- 73
1
vote
1 answer
Instance of connect-mongo module do nothing
Hie. I've a problem. I use windows and my app is a nodejs app. I store sessions in mongodb and use connect-mongo module. And this is my problem:
var session = require('express-session');
var MongoStore = require('connect-mongo')(session);
var…

lutaev
- 298
- 1
- 4
- 20
1
vote
1 answer
How to set up Mongoose and connect-mongo?
I had an Error setting TTL error when starting my application in Express. Maybe the problem is because I use for sessions and for DB operations the same database through different connections.
So it there a specific sequence of requiring…

Pio
- 4,044
- 11
- 46
- 81
0
votes
1 answer
express-session with MongoStore working in Postman but not working in browser
I am using MongoStore to store session.
Following snippet initializes the usage of express-session and MongoStore
import session from "express-session";
import MongoStore from "connect-mongo";
app.use(session({
secret: env.SESSION_SECRET,
…

Goofy Programmer
- 3
- 3
0
votes
0 answers
req.session.useer is undefined if logging out or testing if it is authenitcated
I am using Express and node for a react app and the google authentication is not working. I am using the express-session. When I log in to my react app, it can recognize the req.session.user, but when I log out or use a route to get the user, it is…
0
votes
0 answers
Slow down the response when using store in passport session Nodejs, Angular
I am using passport for authenticating local user in nodejs and angular.
I am using connect-mongo for storing session.
but when i am using store, my application getting slow response from nodeJs server.
import MongoStore from "connect-mongo";
import…

Atul Pisal
- 11
- 2
0
votes
1 answer
Express passport local always login as the last login session in iisnode
I have a Web application using express and authenticate by passport local strategy and store session with connect-mongo. The app work fine on localhost, but when I deploy it with iisnode, its behavior becomes abnormal. After the first User A logged…

dinhit
- 672
- 1
- 17
0
votes
0 answers
Need to repeatedly link mongodb since migration to connect-mongo v4
I just migrated from connect-mongo v3 to v4. When I ran the application I got the error Error: Cannot find module 'mongodb'. After some research I tried the command npm link mongodb which appears to work. But after I shut down my application/server,…

JarrettD5309
- 61
- 7
0
votes
0 answers
I am getting error that say -> TypeError: Class constructor MongoStore cannot be invoked without 'new'
`Error TypeError: Class constructor MongoStore cannot be invoked without 'new'
** MY code is:**
const url = 'mongodb://localhost/pizza';
mongoose.connect(url, { useNewUrlParser: true, useUnifiedTopology: true });
const connection =…

Gautam Gupta 36
- 1
- 1
0
votes
2 answers
`req.session.user` is `undefined` when using `express-session` and `connect-mongo`
I've created a react app that runs on port:3000 and an express app that runs on port:3001.
I am using express-session and connect-mongo to handle user sessions. When I set a user session in /login it was recorded in MongoDB as expected. But when I…

Shafayat Alam
- 702
- 1
- 14
- 32
0
votes
0 answers
How do I create/remove a session in Express session?
I'm using Express Session along with Mongo Store. My session is configured so that it stores it's sessions in a Mongo Database. When I visit the app, a new session is being created. I want it so that a session is created ONLY when a user signs up…

Tommaso
- 3
- 2
0
votes
0 answers
Change TTL connect-mongo expiration option to session time
I'm trying to store sessions into MongoDB. The problem I'm facing is that I can't set the MongoDB TTL to the session duration.
Here's my code :
app.use(session({
secret: md5("test"),
resave: false,
saveUninitialized: true,
store:…

Xeway
- 41
- 7
0
votes
1 answer
Manually destroy specific express session from connect-mongo
is there any possible method for me to delete specific session from mongoDB?
My scenario is to allow 'myself' to delete specific session from DB (other user session). Reading from connect-mongo docs, I can use destory but looks like this method is…

rushgsp
- 11
- 1
- 4
0
votes
2 answers
Timing issue using `connect-mongo` and Mongoose with MongoDB Atlas
I am using connect-mongo for my ExpressJS Session Store and Mongoose for my DB connection and am having, what I will call, a timing issue with it. Here is my code:
dbservice.js
const mongoose = require('mongoose');
const debug =…

Jeremy M
- 179
- 2
- 13