It's fairly safe to just use session, what you should do is add a session var called usrlevel or something like that so normal users cannot get into admin type stuff. You really don't need to re-check the password, because in order to have that var true they had to login already...but if it's a like mission critical type script you should get into checking session id's.
just use:
if(!isset($_SESSION['username'])){
echo "Your not logged in you foo!";
header("Location: whateverurloginpage.php");
} elseif(isset($_SESSION['username']) && $_SESSION['level'] > "0"){
echo "your logged in!";
// all your top secret info.....
} else {
echo "There has been a login erroR!";
header("Location: whateverurloginpage.php");
}
That would work if you have a userlevel system set up..."0" being a non-logged in person, 1 being normal logged in user, and "3" being admin.
It'll just check to make sure your AT LEAST a logged in user.
Now, if people can still view parts of the page without loggin in then instead of:
echo "your logged in!";
// all your top secret info.....
} else {
do:
$loggedin = "hellya";
} else {
and then have all the compnents test to see if logged in == hellya.
[edit]doing the password in session is naughty! lol it's not very safe to store it in the session unless you encrypt it...but thats kinda too much code!