: using $_SESSION instead of register().......
| From: | John Mpaliza | Date: | Thu, 01 Jan 1970 00:00:00 +0000 |
| Subject: | : using $_SESSION instead of register()....... | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-90728@lists.php.net to get a copy of this message | ||
I'm using Apache-win-php4.1.3 and can't create session variables by using
session_start() and $_SESSION['.......']. I'm new to php, please help.
Next week I tried php4.1.1 and all was working well. Now, using php4.1.3,
compiled as an Apache module and with session.use_trans_sid=1 in php.ini, I
can't redirect a page to another and access the $_SESSION['variables']
defined in the 1st document. All codes that were working correctly first now
do not.
es. pageone.php
<?php
session_start();
$_SESSION['var']="testsession";
header( "Location: anotherpage.php?".SID);
exit;
?>
-----
anotherpage.php
<?php
session_start();
print $_SESSION['var'];
..................
?>
N.B: I got a warning: undefined index : var; and make some controls I
noticed that $_SESSION['var'] is not set in the anotherpage.php. And in
pageone.php, $_SESSION['var'] is set as a normal variable but not a session
variable because all files (sess_21ae6dg34............) are EMPTY.
Please help me. Thank u.
John