Good I have a problem with an exercise when visualizing the created cookies.
I have the following directory tree:
- / (the default directory where php hosts)
- / level
- / level / level2
So the problem is that if I create a cookie by putting it as path / level1 or / level1 / level2 I am not able to visualize these cookies, but I can visualize the ones with path "/"
The code with which I create the cookie:
if (isset($_POST['envio'])) {
$nombre = sanearDato($_POST['nombre']);
$contenido = sanearDato($_POST['contenido']);
$nivel = sanearDato($_POST['nivel']);
if (empty($nombre)) $nombre = "NONE";
if (empty($contenido)) $contenido = "NONE";
switch($nivel) {
case "0": $nivel = "/"; break;
case "1": $nivel = "/nivel1"; break;
case "2": $nivel = "/nivel1/nivel2"; break;
}
setcookie($nombre, $contenido."_".$nivel, time()+60*60, $nivel);
}
When I visualize the $ _COOKIE with var_dump it does not show me any cookies to which I have given a different path to "/", but those that have it.
Is there any way to be able to visualize those cookies that have path / level1 or / level1 / level2?
Greetings.