pro_php thread: how to access (and change) a session variable from within a function
Thank you, I think this is the cleanest way to access session variables
from within a function.
Louis
>
Use the superglobal array, $_SESSION, to access session variables directly.
for example:
function do_login($username, $password)
{
// check username and password here
if($valid_login)
{
$_SESSION['logged_in'] = true;
}
}
nik
|





