You may be referring to cookie stuffing ... the most commonly used method is a 1x1 iframe with the site owners aff url in it. When the url is loaded (not visible to the visitor) the cookie is set with their aff id, thus, they receive credit for any actions taken by the visitor for however long the cookie lasts (most expire in 30 days.)
On the other hand, you may be talking about all the spyware progs out there that actually modify the most common cookies (ebay for example) and swap the existing aff id with the spyware companies id.