added functions to store mongodb session
added more auth functions