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

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=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.