I have PHP 4.2.2 with register_globals=off.
It seems like session vars stored in $_SESSION[] aren't visible to
functions. For example, this won't work for me:
$status = user_access();
function user_access() {
if ( isset($_SESSION['user']) ) { return 1; }
else { return 0; }
}
Result is that $status = 0 even though I know those session vars are set.
if ( isset($_SESSION['user']) ) {
echo "Logged In";
} else {
echo "Not Logged In";
}
Result for the above is "Logged In" even though I'm checking the same
session var. My script does include session_start(); as well.
So, is there a way I access session vars stores in $_SESSION[] from a custom
function? Thanks!
Monty
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php