neridaj Posted April 17, 2008 Share Posted April 17, 2008 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 Link to comment https://forums.phpfreaks.com/topic/101508-session-basics/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.