Questions tagged [connect-mongo]
100 questions
0
votes
2 answers
MongoStore: Cannot Init Client. Not accepting mongoose connection object
I am trying to use an AWS DocumentDB (AWS-branded MongoDB) to help me store session data. I've already got a successful connection, with mongoose, to the database in my db.js file.
When I try to pass this mongoose connection to the as the…

lowcrawler
- 6,777
- 9
- 37
- 79
0
votes
1 answer
How to refer same mongo store from one node app to other app using connect-mongodb-session package
I have two node app projects, where one is for the login authentication server (server_app.js) and another one is dashboard node project (app_dashboard.js). I'm storing sessions in mongodb store collection named sessions.
server_app.js
const…

Pranay Chandale
- 110
- 7
0
votes
1 answer
React, connect-mongoose & Express session/user login
I'm trying to get sessions to work with a React front-end and an express + connect-mongo using MongoStore back-end.
Handle Register Function
async function handleRegister(evt){
//Prevent default form redirect.
evt.preventDefault();
…

rwright94
- 45
- 1
- 7
0
votes
0 answers
secret key on storage session does not work
As I understood the secret key option in connect-mongo, causes that the _id of the session inside the session store in db encrypted by the secret key and send it to client as cookie. But actually I could see the same id in the db inside the cookie…

Sami
- 17
- 8
0
votes
1 answer
Can't use express session in my mutations
Hello everybody I have problem with express session. I have created my session with express-session and used it in my apollo-server-express but inside my login mutation when i want to use the session to store my user id and again use that session in…

Mj Ebrahimzadeh
- 587
- 9
- 22
0
votes
2 answers
Sessions not persisting with express-session and connect-mongo
My express server is using express-session and connect-mongo and it's generating a new session for each request from the same user instead of persisting one session like it's supposed to. This is my first time using express sessions but I don't…

PlanetVaster
- 507
- 1
- 6
- 18
0
votes
2 answers
connect-mongo error while building with tsc: Cannot find module 'mongoose'
I'm using connect-mongo to store sessions in a typescript project directly with the mongodb driver, without using moongose.
I'm initializing it with clientPromise as following:
const store = new MongoStore({
clientPromise: getMongoPromise(),
…

aghidini
- 2,855
- 5
- 29
- 32
0
votes
1 answer
connect-mongo is not working if we use clusters
connect-mongo is not working for shared mongo clusters. We have added "connect-mongo": "^0.8.2" module in our application, added the below config details.
"mongoStore": {
"url" :…

Anand Rajagopal
- 1,593
- 6
- 24
- 40
0
votes
1 answer
Store session in operation hook - Loopback
I want to store some data other than userId or accessToken to store in a session, in after save or before save operation hook in Loopback application using express-session.
I have this in my server/server.js :
....
const session =…

lazzy_ms
- 1,169
- 2
- 18
- 40
0
votes
2 answers
Can I force a session to update from the server side?
I have user profiles created by passport, which get stored in mongodb with connect-mongo. If i update the users profile for a session, I have to run req.login() to trigger passport to update the users session to match the new database info. If I…

stackers
- 2,701
- 4
- 34
- 66
0
votes
1 answer
sails.js session data not saved into db
I might be doing something wrong. Please guide me in right direction.
I am trying to implement sails session feature with 'connect-mongo'. I did the implementation same as explained in the docs Sails session mongo. After successful authentication I…

Ravi Kant Mishra
- 778
- 1
- 7
- 13
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
- 3
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…

Lukas Bobinas
- 651
- 8
- 11
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
- 19,858
- 28
- 78
- 107
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…

Bernard
- 23
- 4