added login/logout functionalities.