Help debugging a session issue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I am trying to figure out why this session variable is not passing
from one page to another, the first page handles the security
processing. The second page is a block of code for a snippet on pages
to check for authentication.  I am not including all the code, simply
the relavant portion. The second page is giving me an undefined index
error. Thank you to anyone that can help me.   David

if ($num !=0) {
	session_start();
	session_register('loginusername');
if (isset ($_SESSION['loginusername']))
	$_SESSION['auth'] = 1;
	$_SESSION['loginusername'] = $username;
	header("Location: ../newlogin/username.php");
	}
	else {
	print "<h3> Unauthorized Login </h3> <br><br><a
href='../newlogin/login.php'>Please Try Again</a>";
	exit;
}

----------

<?
session_start();
if ($_SESSION['loginusername'] == 1) {
	print $_SESSION['loginusername'];
} else {
	print "Not Logged In";
	}
?>








[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux