Meteor Mysql and Session

I am using Meteor with Mysqljs and have been able to achieve quite a number of things which i am gonna write a tutorial on.

The issue i am having is I want to be able to keep user session, if user logs in, I want to create a session that is not MongoDB dependent and use it both on client and server side.

Please any idea on how to achieve this


If you need to completely eliminate mongodb for your user database, you should remove meteor’s accounts packages and instead, create your own or try integrating a third party solution.

The thing is, meteor’s accounts system assumes there is a mongodb connected to the app and creates and reads from the users collection as well as a few others.

Edit: you may want to look into solutions that involve:

  • use mongodb for accounts and live with it, while using mysql for other app data
  • use mongodb for accounts and synchronize meteor’s accounts collections to and from tables on mysql. this would probably something you may want if you need other apps to directly access or overwrite the user data from mysql tables
  • use an external authentication mechanism, one that is based on outh or ldap, use that as your single source of truth while knowing that meteor keeps some duplicate information on its own mongodb database for its internal accounts system management requirements
  • remove the meteor accounts packages, use a third party oauth based client-only solution and not expect user session information on the server at all
1 Like