Session management
| From: | Herman Scheepers | Date: | Fri, 22 Oct 2004 06:10:50 +0000 |
| Subject: | Session management | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-200059@lists.php.net to get a copy of this message | ||
Hi
I am a PHP newbie from a Java/C/Oracle background. I
cannot seem to get session management with PHP
working.
<?php
#echo 1;
$old = ini_set('session.use_cookies', 0);
session_start();
$username = $_REQUEST["username"];
session_register($username);
echo "old=".$old;
echo $username;
include_once("db_security.inc");
echo "PHPSESSID=".$PHPSESSID."\n";
$Postfrom = $_REQUEST["username"];
$Postpass = $_REQUEST["password"];
if (__user_authenticate($Postfrom,$Postpass))
{
$display = '>>Welcome '.$Postfrom.' !';
echo '<a href="ht_next.php">Next</a>';
echo $display;
} else {
echo "Login Failed!";
}
?>
In ht_next.php I have:
<?php
session_start();
echo $username;
?>
$username seems to be empty at this point.
echo "PHPSESSID=".$PHPSESSID."\n";
in the first script does not produce any output
either.
Any help would be appreciated.
Herman
_______________________________
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com