Hello !
I got a system where the user can login with username/password. The code-snipped is attached. It works fine, every page got $user and $pass.
The problem: In the system, a user could login. Okay. Then another user should be able to login without closing the browser ! I tried session_unset(), session_destroy, but after calling Check the 2nd-time, the first user is stilll logged on.
Ideas ?
Martin
To login, I call:
function Check($name, $password)
{ global $pass, $user;
// ..check, is $name and $password fits
...
// start Session
session_unset();
session_start();
$user = $name;
session_register("user");
$pass = md5($password);
session_register("pass");
}
To get $user, $password on every page, I use:
session_start();
print "User:".$user."<P>\n";
print "Pass:".$pass."<P>\n";