1 <?php if (isset($_COOKIE["db_cookie"])) { 2 if ($_COOKIE["db_cookie"] == "https_cookie") 3 echo 'PASS'; 4 else 5 echo 'FAIL'; 6 } else { 7 header("Set-Cookie: db_cookie = http_cookie; expires=Thu, 12-Apr-2312 08:32:29 GMT;"); 8 $path = str_replace("http-cookie-database-set.php", "http-cookie-database-update.php", $_SERVER["PHP_SELF"]); 9 $newurl = 'https://'.$_SERVER["HTTP_HOST"].$path; 10 $location = 'Location:'.$newurl; 11 header($location); 12 } 13 ?> 14 15