A lot of researching on stackoverflow told me that getting/setting cookies from other domains isn't possible.
but I can see youtube.com is doing that with google.com
How are they doing that then?
Cookies are files created by sites you visit. They make your online experience easier by saving browsing data. The cache remembers parts of pages, like images, to help them open faster during your next visit.
YouTube by default sets a tracking cookie for marketing purposes. In other words, when you embed a video, you are inviting third-party cookies onto your site.
Cookies are set on a per-user basis only.
Cookies are per-browser, but plugins (such as Flash) have their own storage and can be used to share information between browsers.
Your first statement is correct - it is not possible to get/set cookies from other domains.
That list of cookies shows what was set when you viewed the page, but you must remember that the page includes resources from different locations (images and scripts). When a script or an image is pulled from a different server, it has the opportunity to set a cookie as well. Although the page on youtube.com caused all of those cookies to be set, it only has access to the ones actually on youtube.com.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With