Carlo Fontanos

Full Stack Developer

MongoDB Authentication Using PHP

Recently, a client of mine wanted to have an authentication system for their existing Web Application. They are currently using MongoDB as their Database and just wanted to implement a simple Login, Register and Account page for their customers.

I did not have much experience working with MongoDB before I accepted the project so I struggled a little bit figuring out a way to make an authentication work with MongoDB, but soon after – I realized that the focus of the logic should be on PHP itself, not MongoDB. So then I started coding until I finally finished a simple session based authentication.

Instead of pasting the entire code in this page, I decided to put the project on Github.