Session Issue
| From: | Seth Willits | Date: | Sat, 30 Aug 2003 01:51:22 +0000 |
| Subject: | Session Issue | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-161217@lists.php.net to get a copy of this message | ||
I'm logging in via a form, and on the form page it creates the session:
<?php
session_start();
if ($_POST['username'] == $username && $_POST['password'] == $password ) {
$_SESSION['loggedIn'] = true;
} else
$_SESSION['loggedIn'] = false;
?>
And later in the same page, I include another file which has the links to the pages within the secured section of the site:
<?php if ($_SESSION['loggedIn']) require("section_nav.php"); ?>
From there, when I go to another page, that same line of doesn't work, as the links are not shown. Any idea on why that's happening? Did I miss a step?
Seth Willits
---------------------------------------------------------------------------
President and Head Developer of Freak Software - http://www.freaksw.com
Q&A Columnist for REALbasic Developer Magazine - http://www.rbdeveloper.com
Webmaster for REALbasic Game Central - http://www.freaksw.com/rbgames
"Black holes are where God divided by zero."
-- Steven Wright ---------------------------------------------------------------------------