Código:
<?php if(isset($_COOKIE['probando'])) {
$_COOKIE['probando']++;
setcookie("probando",$_COOKIE['probando']);
} else {
setcookie("probando",1,30);
}
echo $_COOKIE['probando'];
?>
<html>
<head>
<title> Index </title>
<link rel="stylesheet" href="estilo.css" type="text/css" />
</head>
<body>
<div class="formato"> <?php echo $_COOKIE['probando'];?></div>
<div class="cabezal">
<form action="sesion.php" method="POST" style="">
<label><span>Usuario</span>
<input type="Text" name="usuario" size="15" maxlength="10">
</label><br>
<label><span>Constrasenia</span>
<input type="password" name="contrasenia" size="8" maxlength="10">
</label><br>
<input id="btn" type="Submit" value="ENTRAR"><br>
</form>
</div>
</body>
</html>
Queria saber porque cuando cierro el navegador y vuelvo a abrir la cookie es como si no existiera y me empieza a contar desde 0 otra vez.