Re: Session Issue

From: Date: Sat, 30 Aug 2003 02:44:52 +0000
Subject: Re: Session Issue
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-161220@lists.php.net to get a copy of this message
* Thus wrote Seth Willits (seth@freaksw.com): > 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; > ?> > ... > > <?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? Does the next page call session_start()? all pages that use $_SESSION, must call that first. Curt -- "I used to think I was indecisive, but now I'm not so sure."

« previous php.general (#161220) next »