It's just using URLs.
All hyperlinks on Amazon are fixed with a "ref" variable (or whatever it is those things are called in URLs) that is some sort of unique identifier. So Amazon stores your browsing history by associating it with that unique identifier, and links are presented to you with that identifier in them. Just go to https://www.amazon.com/gp/history/ instead of the links you see, and you'll see no history. Similarly, erase all the junk after the product number in the URL for something (so it's just something like http://www.amazon.com/Free-Software-Society-Selected-Stallman/dp/1441436855/) and Amazon's server probably isn't identifying it with you in any way (I say "probably" because it might be keeping a list based on your IP address, but I doubt this is the case; IP addresses aren't very unique anyway).
