Storing variables $GLOBALS vs. $_SESSION

Hello,
I need to store several variables in login.php for use in index.php. I tried:

$_SESSION[‘logged_in’] = true;

but when index.php tries to access this variable

$status = $_SESSION[‘logged_in’];

its not set.

Help please.

At the top of every page that you are using session variables you must have session_start(); before you use the session variables.

Thanks, it works!
Cant believe PHP is so powerful. Just started using it a few days ago.
Thanks again,
-Charles

Sponsor our Newsletter | Privacy Policy | Terms of Service