Forum Moderators: open
I want to set two cookies to user's web-browser in foo2.com but when user visits foo1.com. Very similiar to the system used by web statistics.
I use (within 'http://www.foo1.com/page.html'):
------
<img src="http://www.foo2.com/image.php" />
------
And 'www.foo2.com/image.php' sets the two cookies.
It works ok on Firefox on Linux, but doesn't work with Firefox on MS Windows and IExplorer. Any similar experience? Thank you very much.
A cookie should only be able to be read from the domain it's set on. However, what you *can* do, using PHP, is send a value via query string to set a new cookie on domain2:
domain 1
set-cookie:my_cookie=my_value123;path=/;
[example_domain2.com...]
domain 2:
set=cookie:my_cookie=$_POST["c"];path=/;