finish login logout