Jump to content
Fórum Script Brasil
  • 0

Erro De Logout


oberlan
 Share

Question

Ai galera to com um probleminha, contrui um sistema de login baseado em cookie, está funcionando beleza, mas quando a pessoa pede pra fazer o logout ele não o faz, ou seja, ele não exclui o cookie e a pessoa continua logada.

O código do Logout esta assim:

<?php

$admin = $_COOKIE['revhack'];

$admin = base64_decode($admin);

$admin = explode(":", $admin);

$u4 = "$admin[1]";

include("inc/db.inc.php");

include("inc/type.inc.php");

$status = mysql_query("update users set status=0' where username = '$u4' ");

$session = mysql_query("DELETE FROM session WHERE usuario='$u4' AND host='$_SERVER[REMOTE_ADDR]'");

$tempo = "1";

$admin = $_COOKIE['revhack];

setcookie("revhack", $admin, time()-3600*$tempo);

print "<script language='Javascript'>

window.open('../index.php', '_parent');

</script>";

?>

Se alguém poder me ajudar e me dizer o que estou fazendo de errado ficarei muito grato.

vlw

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



  • Forum Statistics

    • Total Topics
      151k
    • Total Posts
      649k
×
×
  • Create New...