10-22-2008, 08:38 AM
|
#6 (permalink)
|
|
The Wanderer
Join Date: Sep 2008
Posts: 8
Thanks: 1
|
Yeah, it's an area I've been meaning to get into for a while, but I've never had a "real life" project that needed it (until now).
I'm reading through that article right now. Very useful for a novice such as myself.
One question - can you check to see if multiple parts of the session have been set?
For example...
PHP Code:
<?php
session_start();
// Check the session to see if it has been set
if (isset($_SESSION['sess_userName']) &&
isset($_SESSION['sess_passWord']) &&
isset($_SESSION['sess_niceName']) &&
isset($_SESSION['sess_sessionId'])) {
// Do not need to do anything as the user is logged in
}
else {
header("Location: ../index2.php"); // Redirect to the log in if the session is not set
exit;
}
?>
When someone logs in it works fine, but when I destroy the session and try to navigate back to the secret area, it doesn't bounce me to ../index2.php (as it should do), but instead just displays a blank page.
|
|
|
|