I used setcookie on my local server and everything worked out, but when I climbed to the local server does not work

Asked

Viewed 52 times

1

I used setcookie("votados".$_POST['votacao'], 'yes', time()+86400*300); on my local server and worked divinely well, but when climbing it does not work. Like, he was supposed to check whether the user has voted or not. Could someone give me a little help?

  • 3

    if you want to allow people to vote only once to use a cookie may not be the best option, since the user can easily delete them.

1 answer

1


If anyone ever goes through a problem like setcookie, here’s the solution I found:

ob_start ();  // No início do código 
ob_end_flush ();  // No final do código 

To learn more about ob_start and ob_end_flush.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.