This is needed to deal with hostname changes during lifetime of a session.
mentioned in commit d9784a5f