Problem, session_destroy(); works but only once?

Hi guys,

Please can anyone help me with this problem?

Actually I’m pretty dummy in PHP/MYSQL but this script works but only once, when I again log in I can’t logout anymore, only if I restart browser mannual I can log out and have an option to log in again!

(I’m really trying three days to find solution and I must smile instead become absolutely insane)

Here is the problem:


<?php
$result = mysql_query("SELECT * FROM `users` WHERE id=1");

$row = mysql_fetch_array($result);

$adminas = $row['vartotojas'];

$pass = $row['slaptazodis']; 

session_start(); 

if (($_SESSION['user'] != $adminas) || ($_SESSION['pass'] != $pass)) 

{
header("Location: index.php");

}

$id= $_GET['id'];

if($id == "logout")

{
session_unset();    
session_destroy();
header("Location: index.php");

}
?>

<tr><td class="pageName">Administration Panel</td></tr>
<tr><td class="bodyText"><br />

          <div class="padding"  align="left" >

          <a href="index.php?eid=statistika">Statistics</a><br />

        <a href="index.php?eid=informacija">My information</a><br /><br /></div>

        <div align="left" ><a href="/administrator/index.php?id=logout"><button class="negative">

        <b>Logout</b></button></a></div><br /></td></tr>

What I’m doing wrong? :expressionless:
Any suggestion will be very helpfull!

Thank You in advance!