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!


Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

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=],[/link] anybody can check where is the issue?

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 = "<?php echo $resultado[1]; ?>";




alert("Login/Senha n


Sign In or Register to comment.