I used setcookie on my local server and everything worked fine, but when I uploaded it to the local server it does not work

1

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

    
asked by anonymous 26.06.2015 / 14:20

1 answer

1

If someone ever had a setcookie problem, 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 .

    
26.06.2015 / 15:59