Adding login/logout logic.