Easier said than done. You can create a "cookie" by simply sending a unique image to a users browser with a long cache time, and then reading that back with JavaScript on each page.
If you disable your browsers cache and/or JavaScript, I guess that would fix this particular issue.
If you want to keep both the cache, and JavaScript, then you need to stop people from doing this sort of thing, with legislation.
Explain why what I said is ridiculous, or I'll discard your comment as nonsense.
If we don't have a technical solution for a problem (which we don't in this case), then regulation is appropriate. If and when we find a technical solution for this problem, then the legislation will be deprecated. Until that point, it is useful.
What is "ridiculous", is assuming that all problems have technical solutions.
If you disable your browsers cache and/or JavaScript, I guess that would fix this particular issue.
If you want to keep both the cache, and JavaScript, then you need to stop people from doing this sort of thing, with legislation.