Why is my web history piping up on my old phone?

I upgraded my iPhone. I gave my old phone to my son. While shopping online all of my Walmart websites page had piped up under his history. Luckily I don't thank he had noticed it. But why is this happening and how do I stop it?

If you're using the same Apple ID on both phones, they sync with each other.

Ideally, you both have your own Apple IDs, but if you don't want to do that, I believe you can disable that.

Settings>iCloud>turn off Safari Do that on both phones to prevent them from syncing Safari history.