I'm trying to check if a cookie isset
right after I setcookie
. It works but I have to reload the page before the correct php file is loaded.
This is how I'm doing it:
//set cookie
$cookie_value = "Cookie";
setcookie("Placed", $cookie_value, time()+86400);
//check if cookie is set
if (isset($_COOKIE['Placed'])) {
include("display.php");
} else {
include("nodisplay.php");
}
Is there something that I'm missing?