PHP 4.0 Bug #3111: Can't set a session variable from an include file
| From: | jshuping at scient dot com | Date: | Wed, 05 Jan 2000 23:32:07 +0000 |
| Subject: | PHP 4.0 Bug #3111: Can't set a session variable from an include file | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-14293@lists.php.net to get a copy of this message | ||
From: jshuping@scient.com
Operating system: Solaris 2.7 Sparc
PHP version: 4.0 Beta 3
PHP Bug Type: Other
Bug description: Can't set a session variable from an include file
PHP 4.0b3, compiled with mysql and enable-trans-sid.
Using apache 1.3.9.
Normal php config, GPC_globals is on, using cookies, auto_start = 0.
Here's an example of the problem:
index.php:
<? session_start()
include('foo.inc');
testfunc();
?>
<html>
<link to index2.php>
</html>
foo.inc:
<? session_register("USERID");
$USERID = "foo";
?>
Loading index.php, and clicking on the link to the second page, leaves the following
in /tmp/sess_BLAH:
!USERID|
Whereas putting the contents of testfunc() in index.php and performing the same action leaves the
contents of sess_BLAH as:
USERID|s:3:"foo";
Is this a bug or am I missing something here?
Thanks
John