Implemented login/logout functionalities.