1) Checking the data received through reg form and then After making the connection with Mongodb     (mongoose), Storing  the data in it.

2) Checking the data received through singin form and comparing with the records in DB showing error on not found or storing the id in seesion when found