Say I have a website called a.com, and when a specific page of this site is loaded, say page link, I like to set a cookie for another site called b.com
a.com
b.com
Setting cookies for another domain is not possible.
If you want to pass data to another domain, you can encode this into the url.
a.com -> b.com/redirect?info=some+info (and set cookie) -> b.com/other+page