Added login/logout functionality.