I'm here asking why unfortunately I've tried all the alternatives in polls since last week. And I'm probably doing something wrong.
Come on:
setcookie("email", "email", time() + (360 * 24 * 3600));
This is the code that I created the cookie. That is in the header before reading the html. For the cookie to last 1 year.
However, the other day he inserted this cookie again. I make a check to see if it exists and then I enter the record in the database, to have control:
if(!isset($_COOKIE['email'])){
setcookie("email", "email", time() + (360 * 24 * 3600));
mysql_query("INSERT INTO db(id, email, data) VALUES (0, 'email', NOW() )")
}
I do not know the reason for the error. Maybe I have to configure php.ini, or something else. But I already researched and did not find the error. This is the first time I work with cookies.
Who can help me, I thank you.