Session Vars
| From: | Jason Paschal | Date: | Wed, 18 Jun 2003 20:41:43 +0000 |
| Subject: | Session Vars | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-152064@lists.php.net to get a copy of this message | ||
setting up some pages to allow users to log in, and store their userID in a session var.
for development purposes, i've installed AMP on my windows box.
-everything parses fine
-register globals is on.
problem: session vars do not seem to be carrying over pages, even when i set the session_id to initial value.
i start the session and save the variable:
session_start();
$PHPSESSID=session_id();
$_SESSION['userID'] = $userID; //i've checked and $userID DOES contain a value: 1
//If i echo $_SESSION['userID']; then it prints 1.
header("Location: nextpage.php?PHPSESSID=$PHPSESSID");
exit;
on nextpage.php:
session_start();
session_id($PHPSESSID);
echo $PHPSESSID; //the session id is printed
echo "<br>";
echo $userID; //nothing is printed
echo $_SESSION['userID']; // nothing is printed
Is it something with the ini file?
Thanks in advance!
Jason P.
_________________________________________________________________
Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963