Any help on this would REALLY be appreciated.
I'm trying to emulate a cookie-based affiliate system on online product-marketing website (let's call it source.com) which lists products from several online shops.
The users are redirected to the shop's specific purchase page by clicking on the "Buy" button of a specific product from a specific shop.
The action of clicking on the "Buy" button invokes a cookie which is installed on the user's machine, that cookie contains a single value which is the shop's unqiue ID number.
On the checkout page of the shop's website, a hidden image tag is printed pointing back the source.com tracking script with the sale details. The details are verified and stored in the database only if the cookie installed on the user's machine contain that specific shop unique ID number.
Example:
1. A user is browsing source.com and clicks on a product from shop.com
2. source.com installs a cookie with the ID number of shop.com ->
3. The user buys the products from shop.com
4. Shop.com checkout page outputs the following image tag:
<img 'src=http://www.source.com/track.php?order_details...' width=1 height=1>
5. track.php reads the cookie and checks the value in it, if it matches the shop's ID then it stores the sale information in the database.
NOW, the problem is that track.php can NOT read the cookie, why is that? and any ideas of how I can solve this?
I know that cookies can not be read from different domains, but here I'm actually calling track.php which is on source.com, that is the same domain which invoked and installed the cookie on the user's machine.
For some reason, even if I'm calling track.php which is on source.com, the cookie still can not be read because the image tag is on another domain.
When I tried to output the image tag on source.com, it worked.
Any ideas of out to fix this would be really appreciated