added login/logout functionality.