Hy to everybody,
i'm trying to set a cookie in a PHP page. At the beginning of the page i have this code:
setcookie("Cookie_SC_Stagione", "$value", time()+2592000);
This work fine but you must refresh page to have cookie updated. So i have found in PHP manual to do a redirect to 'force' cookie update. So i have inserted header and now my code is:
setcookie("Cookie_SC_Stagione", "$value", time()+2592000);
header("Location: [url]http://[/url]".$SERVER['HTTP_HOST'] . $SERVER['PHP_SELF']);
But now i have a problem with the setcookie. More, it seems that my cookie is no more setted.
Can someone tell me the code i have to insert in my page to do a good setcookie?
TIA