Does anyone know why these setcookies()
do not work? No cookies are getting written to the local machine:
<?php
setcookie("repeat_visitor", "yes", time() + (10 * 365 * 24 * 60 * 60), "/", "www.mydomain.com");
setcookie("repeat_visitor", "yes", time() + (10 * 365 * 24 * 60 * 60), "/", "mydomain.com");
?>
AMENDMENT
Well, here is what I want to do -- I want to display a message to the visitor when they hit my site once, on the first time someone hits the site. After that hit, I do not want to display the message any longer to that visitor. I am thinking setting a cookie is the way to go with that.
If it is not, can you share any other suggestions?
Thanks.