I need a simple function to count unique visitors though an image from www.my-site.com
SITE 1: www.my-Counter-site.com
file: counter.php
<?PHP
if(!$uniqueVisitor){
setcookie("uniqueVisitor", "true", time()+86400,"/"); /* expire in 24 hour */
count_uniqueVisitor(); // Count unique visitors
}
?>
If I access the file directly in the browser
http://www.my-Counter-site.com/counter.php
Then I set a cookie like this:
uniqueVisitor
true
www.my-Counter-site.com/
1536
930713856
29598389
1832915744
29598386
And that is fine, but I also want to set the same cookie if I access the file trough an image from other site like this.
SITE 2: my-site.com
But this will not set a cookie, why?