[Solved] Setting a PHP cookie value to be intentionally vulnerable


i looked at it again, try this:

$cookie_name="Authenticated";

// this checks if the value has been set already
 if (!isset($_GET['cookie_value'])) {
// if no value is set, it defaults to 0 and displays the error message
$cookie_value=0;
$error = "You are not authorized to view this page!";
echo $error;



}

// Now here if the value has been set in the url 
else{
    $cookie_value=$_GET['cookie_value'];

        //when 0 ,error
        if($cookie_value ==0) {
            $error = "You are not authorized to view this page!";
            echo $error;
        }
        // and when its 1 success
        elseif ($cookie_value ==1) {

            $error = "Success! The password for the next level is...";
            echo $error;
            }


}

// when a value is confirmed the cookie is then set
setcookie($cookie_name, $cookie_value);

?>

2

solved Setting a PHP cookie value to be intentionally vulnerable