I was just checking out my scripts.
index.php - starts the session if it's not already started. Calls login.php if user clicks on the login link.
login.php - presents the login form. Displays red "Invalid login" if $_SESSION['error'] is not empty.
validate.user.php - checks the database to see if the user exists; sets $_SESSION['error'] and sends back to login.php if not. Sends to main screen as logged in if the user successfully logged in.
If I didn't call session_start() at the beginning of login.php, the $_SESSION['error'] would always be unset.
I just tried it out by commenting out the session_start() portion in login.php and it never sees the error. When I uncomment it, it sees it right away. So access must need to be enabled in each script before it can be used.
Carl