cookie is not being creater at my website - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

cookie is not being creater at my website

anitaperesanitaperes Posts: 3Member
[color=#006699]I did this code to validate if the user is logged using cookie, but my cookie disappear when i click to any link of my web site[link=http://empresasite.com.br/index.php?q=principal],[/link] anybody can check where is the issue?

[code]<?php
if ( (isset($_POST["login"])) and (isset($_POST["senha"])) ) {

if (preg_match("/<div[^>]*>" . preg_quote(trim($_POST["login"]),"/") . ";" . preg_quote(trim($_POST["senha"]),"/") . ";([^;]*?)/",strip_tags(html_entity_decode(file_get_contents("paginas/area-restrita.php")),"
"),$resultado)) {

$resultado[1] = "area-restrita-" . strtolower($resultado[1]);
setcookie("area-restrita",md5($resultado[1]),time() + 60*60);
?>

window.location = "http://empresasite.com.br/index.php?q=<?php echo $resultado[1]; ?>";

<?php

}
else{

usleep(2000000);
?>

alert("Login/Senha n

Comments

Sign In or Register to comment.