Concerning session vars inside of a function, why do they not work properly when written inside of a function?
I tried writing a session var inside of function authenticateUser(), but php failed to write it to the session vars.
function authenticateUser($connection, $username, $password) {
session_register("userid");
$userid = "dddddd";
}
So when I tried writing the session var outside of the function it worked of course. So the question is: how do you handle sessions inside of a function? Do you need to pass the function $userid?