Questions tagged [connect-mongo]

89 questions
1
vote
3 answers

Logging in to one Express app destroys session in other (same server)

I have two separate Express 4.x apps running on the same server machine (different ports), sharing a MongoDB instance. They both use different databases and have different session secrets. I am able to log into application A or B individually…
Erik
  • 12,130
  • 5
  • 33
  • 41
1
vote
0 answers

Node.js - Express Session, Connect Mongo, and MongoDB

I have a have several mongo databases for separate parts of a website I am making. One of those databases is for sessions. I am using Connect Mongo to store the sessions in the databases. I can't seem to store in to session a ObjectId that…
1
vote
1 answer

How to access Express(js)-session cookie serverside before responding?

Using a combination of Express-session, Connect-mongo and PassportJS on a Node server I have the following validation function: expressApp.post('/login', function(req, res, next) { passport.authenticate('login', function(err, user, info) { …
1
vote
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
vote
1 answer

Manually deleting connect-mongo session by _id cast error

I'm attempting to manually delete a document from the connect-mongo sessions collection. When I try to delete a document I get the following error: message: 'Cast to ObjectId failed for value "gl9-V-bjAjqv2Nwdf9vHPLN_Fnnl4Thz" at path…
Larry Hipp
  • 5,945
  • 3
  • 24
  • 29
1
vote
1 answer

callback not working in connect-mongo

i have used connect-mongo as session store . connect-mongo@0.4.0. my code is app.use(express.session({ store: new MongoStore({ url: 'mongodb://192.168.1.124:27017/ip_session', }, function(e) { // Start the app by listening…
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
  • 112
  • 2
  • 11
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,284
  • 10
  • 46
  • 71
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
  • 221
  • 3
  • 14
0
votes
0 answers

Error 'Unable to parse ciphertext object!' while using connect-mongo to store session

I'm using connect-mongo package to store session in mongoDB. I followed the package documentation on https://www.npmjs.com/package/connect-mongo to set up the following code: const session = require('express-session') const MongoStore =…
0
votes
1 answer

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
  • 4,717
  • 6
  • 28
  • 42
0
votes
0 answers

connect-mongo: How to implement different session for different users on the same machine?

I want a different sessions for different users if they are on the same machine. Below is the code. I know I can easily do this by directly storing data in the database. Is there any way I can have different sessions on the same system? var session…
Archaic
  • 13
  • 5
0
votes
0 answers

Azure Idendity platform redirects to homepage, ensureAuth fails

I'm trying to implement an Authentication step for my (quite simple) CRUD application. So this is the Idea: when connecting to localhost:8000/ you need to click the login button, which will prompt you to log in with a Microsoft Account. You should…
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…
0
votes
0 answers

Express-session not persisting on reload. (Connect Mongo)

I have the following code base. Express-session seems to not persist despite using connect-mongo. (mongoDB, mongoose, express-session, connect-mongo) I thought it was cors issue since it seems to be persisting on Postman and added the following code…