0

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 vice versa. I don't know how can I solve the problem.

Jean-François Corbett
  • 37,420
  • 30
  • 139
  • 188
Bernard
  • 23
  • 4

1 Answers1

0

Is the goal to keep the sessions from your two apps totally distinct?

I think where you set up your session storage in /config/session.js, you can name the collection used for session storage. Why not use a different name for each of your two apps?

adapter: 'mongo',
host: 'localhost',
port: 27017,
db: mydb,
collection: 'sessions', // Use a different name for each app here
arbuthnott
  • 3,819
  • 2
  • 8
  • 21