Hi,
I have the following PHP code.
<?
session_start();
if($_POST['submit'] == "submit")
{
$_SESSION["KB_username"] = $username;
echo "Your Session username=" . $_SESSION["KB_username"];
echo "<HR>";
echo session_id();
}
if($_POST['logout'] == "logout")
{
session_unset();
// session_destroy();
}
?>
<html>
<head></head>
<body>
<form name="login" action="<?php $_SERVER["PHP_SELF"] ?>" method="post">
<input type="text" name="username" size="20">
<br>
<input type="submit" name="submit" value="submit">
</form>
<hr>
<?php echo $_SESSION["KB_username"]; ?>
<hr>
<form name="logout" action="<?php $_SERVER["PHP_SELF"] ?>" method="post">
<input type="submit" name="logout" value="logout">
</form>
</body>
</html>
If I try to login to the application on the same PC using 2 instances of a browser, the session variables clash.
That is if I logout user-1, user-2's session also gets logged out... Pls help how do I solve this.
I have tried using & hashing session_destroy();
End result:
I would like a user on a computer to be able to login to the application using 2 different username and have individual sessions. If the user decides to logout as user-1, it should not logout user-2
I hope this is not very confusing. I am searching google since a long time and no solution.....
Pls help!
Thx
Vai