finish login, logout