When visiting a website, cookies are stored in the user's browser from two sources: One source is the source code of the website itself. Typically, cookies placed by the website are necessary for functionality or enhance security. The other source is the use of external services (e.g., Facebook button, Google Analytics).