Merging ties and remove the session after login.