I'm using php 4.3.
I'm using sessions for my login and logout. The problem i have is that when I login on the same pc using different accounts its fine. The problem is when I logout one account, ALL session variables are destroyed so my other window with the other account running cannot continue. Can someone help?

part of my login code
Code:
if($user=='admin'){   
        //Connecting to the MySQL server as root and selecting the database     	    
        $connection=mysql_connect("localhost", "admin") or die ("Error ocurred when connecting to mysql server.");
        mysql_select_db("project") or die ("Error ocurred when selecting database.");
 
        $sql = mysql_query("SELECT Password,Login FROM admin WHERE Userid='$userid'");
        $fetch_em = mysql_fetch_array($sql);
        $numrows = mysql_num_rows($sql);

	if($fetch_em["Login"] == "Y") {
	    include 'Project.html';
	    echo "<font color=red>You have already logged in at another location!</font>";
	    exit&#40;&#41;;
	&#125; else &#123;
            // Convert password to md5 hash
            $password = md5&#40;$password&#41;;        		    

            if&#40;$numrows != "0" &&#40;$password == $fetch_em&#91;"Password"&#93;&#41;&#41;&#123;
	    	$sql_get_index = mysql_query&#40;"SELECT ID FROM admin WHERE Userid='$userid'"&#41;;
	    	$fetch_index = mysql_fetch_array&#40;$sql_get_index&#41;;

	    	$sql_login = mysql_query&#40;"UPDATE admin SET Login='Y' WHERE Userid='$userid'"&#41;;
	    	mysql_close&#40;&#41;;
		
	    	session_start&#40;&#41;;  // Start Session
	    	$_SESSION&#91;'ID'&#93; = "A".$fetch_index&#91;"ID"&#93;;	    
            	header&#40;"Location&#58; Padmin.php"&#41;; 
            	exit&#40;&#41;;
            &#125;elseif&#40;$numrows == "0"&#41;&#123;	    
            	require 'Project.html';
            	echo "<font color=red>There is no such ID!</font>";
            	exit&#40;&#41;;	    
            &#125;else&#123;	    
            	include 'Project.html';
            	echo "<font color=red>You have entered an invalid password!</font>";
            	exit&#40;&#41;;	    
            &#125;      	    
	&#125;
my logout code
Code:
<?php
session_start&#40;&#41;;


$index = substr&#40;$_SESSION&#91;'ID'&#93;, 1&#41;;

$AC = substr&#40;$_SESSION&#91;'ID'&#93;, 0, 1&#41;;

//Connecting to the MySQL server as root and selecting the database     	    
$connection = mysql_connect&#40;"localhost", "root"&#41; or die &#40;"Error ocurred when connecting to mysql server."&#41;;
mysql_select_db&#40;"project"&#41; or die &#40;"Error ocurred when selecting database."&#41;;
if&#40;$AC == "A"&#41; &#123;
    $sql_status = mysql_query&#40;"SELECT Login FROM admin WHERE ID='$index'"&#41;;
    $status = mysql_fetch_row&#40;$sql_status&#41;;
&#125; elseif&#40;$AC == "C"&#41; &#123;
    $sql_status = mysql_query&#40;"SELECT Login FROM customer WHERE ID='$index'"&#41;;
    $status = mysql_fetch_row&#40;$sql_status&#41;;
&#125;

//if&#40;$status&#91;0&#93; == 'N'&#41;
if&#40;!isset&#40;$_SESSION&#91;'ID'&#93;&#41;&#41; &#123;    

    ?>    
    Session over!

    To try logging in again, click

    here.
    <?php
    exit;
&#125;

if&#40;!isset&#40;$_REQUEST&#91;'logmeout'&#93;&#41;&#41;&#123;
    echo "<center><font size=5>GLORY GLORY TOTTENHAM HOTSPUR</font></center>
";
    echo "<center><font color=red>Are you sure you want to logout?</font></center>
";
    echo "<center>No";
    echo "

<center><font color=orange>Keller
King
Richards
Gardner
Carr
Ziege
Redknapp
Davies
Ricketts
Kanoute
Keane

Sullivan
Taricco
Perry
Anderton
Acimovic
Blondel
Dalmat
Konchelsky
Marney
Postiga
Zamora</font></center>";	   	
&#125; else &#123;    

    if&#40;$AC == "A"&#41; &#123;
        $sql_logout = mysql_query&#40;"UPDATE admin SET Login='N' WHERE ID='$index'"&#41;;
    &#125; elseif&#40;$AC == "C"&#41; &#123;
	$sql_logout = mysql_query&#40;"UPDATE customer SET Login='N' WHERE ID='$index'"&#41;;
    &#125;
    mysql_close&#40;$connection&#41;;

    unset&#40;$_SESSION&#91;'ID'&#93;&#41;;        
    $_SESSION = array&#40;&#41;;	    
    session_destroy&#40;&#41;;
    header&#40;"Location&#58; Project.html"&#41;;
&#125;
?>