Hello,
I'm just learning about sessions and want to control access to inner pages of a website i.e., restricting access based on whether or not a user is logged in, and also why my sessions never seem to time out.
something like this, but this always calls display_folders()
if ($username && $passwd)
// they have just tried logging in
{
try
{
display_folder();
// if they are in the database register the user id
$_SESSION['valid_user'] = $username;
}
catch(Exception $e)
{
// unsuccessful login
do_html_header('Problem:');
echo 'You could not be logged in.
You must be logged in to view this page.';
do_html_url('login.php', 'Login');
do_html_footer();
exit;
}
}
Thanks for any insight,
Jason