I have this webpage where I want to set a cookie, and if the cookie is set it redirects you to another page. I use to code below, and it all works fine in google chrome, but it does not in safari for some reason. Do you know why this is and/or do you have a solution for it?
//current url: https://thisdomain.com
setcookie("cookie1", "isset", time() + (10 * 365 * 24 * 60 * 60), "/", "thisdomain.com", true, true);
sleep(1);
if (isset($_COOKIE["cookie1"])) {
header("Location: https://nextdomain.com", true, 301);
exit();
}
header("Location: https://www.thisdomain.com", true, 301);
Thank you in advance :)