Implemented login/logout.