Changed the structure of the Session login, also added the connection to the MongoDB