Hello,
I've a problem with setting cookies in php. I've to say that I'm not very experienced with php, so maybe is a very stupid problem.
I've an ajax rating system that should check a cookie to see if the the photo has already been voted.
The page called with ajax check for the cookie, add the id of the photo you are voting to it and call this function:
setcookie("Name", $cookie, time()+(60*24*365), "/", $_SERVER['HTTP_HOST'], 0);
The page that display the photo also call the cookie
$cookie = $_COOKIE['Name'];
and check to see if you have already voted.
A problem may be the fact that the ajax page is in a different directory than the page that display the photo.
The page that display the photo is in the root directory, the page that cast the vote is in /ajax/vote.php
The voting system works, before I was checking the IPs, but know i need to check the cookies.
It work in Firefox without any problem, but when I've started testing on IE and Safari it seem they don't see the cookie.
I've checked with IECookieViewer and when I cast a vote the cookie is created allright, but when I go back to the page, it look like the page don't find the cookie. Also if I cast another vote the cookie is replaced with a new one.
Sorry for the bad english, I hope the problem is understandable
P.S. Forgot to point something that might be related to the problem. The page is inside an iframe.