ID: 27451
User updated by: hamid at wannameet dot nl
Reported By: hamid at wannameet dot nl
Status: Open
Bug Type: Session related
Operating System: FreeBSD
PHP Version: 4.3.4
New Comment:
hi idong,
yeh i find it really strange too. Also because i am not getting any
errors concerning the session itself.
And other annoying thing is the randomness of this problem, because
when i try to invoke the error it is not occuring.
So i am really lost :( ;)
Although i am starting to suspect my hostingcompany
Previous Comments:
------------------------------------------------------------------------
[2004-03-02 16:36:50] hamid at wannameet dot nl
i have put my latest error_log in the directory php_bug
as you can see the session exists but sess_lang and sess_referer are
empty.
// error function
session_start();
$sess_lang = $_SESSION['lang'];
$sess_referer = $_SESSION['referer'];
$session_id = session_id();
$errorString .= "Session_id: $session_id\n";
$errorString .= "Sess_lang: $sess_lang\n";
$errorString .= "Sess_referer: $sess_referer\n";
//
the format for the include files is:
include("content/$sess_lang/filename.inc");
------------------------------------------------------------------------
[2004-03-02 16:35:14] idong at gmx dot de
Hello Hamid,
Really strange...
I tried this again, after reading your comment and now I get:
lang test
1 - de
2 - en
no_lang test
1 - de
2 - en
I swear that I just copied and pastet the results of the script - both
with my first posting and now with this one.
I tried it with register_globals on and register_globals off. This is
really getting strange since you get a completely different result from
my example and me, I got a different result (than the first time) too.
Anyway, the result from my last test (see above) isn't the expected
behaviour either or am I making a mistake?
Ok, lets resume the problem at this point of time:
1. With the same example I got two different results. I changed nothing
in between, only some time went by.
2. Again, using my example, YOU got a completely different result - the
result I would have also expected from my own tests.
3. looking at my latest results, I can say that my first analysis (bug
occurs on use of "lang" as session var name) was wrong.
4. YOU have the problem, that you are "losing vars from my session
occassionaly"
Any help from the PHP crew?
Thanks a lot, idong
------------------------------------------------------------------------
[2004-03-02 15:42:21] hamid at wannameet dot nl
hi idong,
i tried your example, but the result i am getting is
de
de
de
de
with register_globals Off and On
------------------------------------------------------------------------
[2004-03-02 15:06:54] idong at gmx dot de
Seems to me that if it is a special problem of $_SESSION along with
session var name 'lang'. Try this:
<?php
session_start();
echo '<br><br><b>lang test';
$_SESSION['lang'] = 'de';
echo '<br>1 - '.$_SESSION['lang'];
$lang = 'en';
echo '<br>2 - '.$_SESSION['lang'];
echo '<br><br><b>no_lang test';
$_SESSION['no_lang'] = 'de';
echo '<br>1 - '.$_SESSION['no_lang'];
$no_lang = 'en';
echo '<br>2 - '.$_SESSION['no_lang'];
?>
What I get is this:
lang test
1 - de
2 - en
no_lang test
1 - de
2 - de
Maybe there are some more variable names one shouldn't use with
sessions?
------------------------------------------------------------------------
[2004-03-02 05:35:37] hamid at wannameet dot nl
the include files could not be opened because sess_lang was empty, but
i changed my error reporting so that it will capture session_id en
sess_lang. You will receive the new log file as soon as it has some
entries.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/27451
--
Edit this bug report at http://bugs.php.net/?id=27451&edit=1