ID:               19882
 User updated by:  [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
-Status:           Feedback
+Status:           Open
 Bug Type:         Session related
 Operating System: Redhat 7.2
 PHP Version:      4CVS-2002-10-12
 New Comment:

To answer iliaa's question: No, session_start is called on a separate
page. 

This is really weird, I made up the following script as per Sniper's
request:

<?
session_start();
session_register('testvar');
$testvar = "test";
$data = session_encode();
$testvar = "false";
session_decode($data);
echo("$testvar");
?>

Strangely, THIS script works fine (if it was 'broken', it should output
"false", while it in fact prints "test"). 

However, I've made another script where the error is replicated:
www.dfstudios.com/session_test.php

Here's the source:

session_test.php------
<?
session_start();
session_register('testvar');
$testvar = "test";

$data = session_encode();
echo("testvar is \"$testvar\", and has been encoded: $data <br><br>");
?>
<a href="session_test2.php?<? echo("$data"); ?>>Click here for page
two</a>

session_test2.php------
<?
session_decode($QUERY_STRING);
echo("testvar is \"$testvar\", and the string used for decoding is
$QUERY_STRING <br><br>");
?>

Notice how $testvar is properly set on the first page and encoded
properly, but in the second page $testvar is null. It seems that if
session_start and session_decode are called in separate pages the
decode function fails.


Previous Comments:
------------------------------------------------------------------------

[2002-10-12 21:42:27] [EMAIL PROTECTED]

I closed the other report since it really is same issue.
Please add a short simple script which clearly shows the
problem you're having. And all in one single script, thank you.


------------------------------------------------------------------------

[2002-10-12 20:09:30] [EMAIL PROTECTED]

But does that page that calls session_decode call session_start itself?

------------------------------------------------------------------------

[2002-10-12 20:02:38] [EMAIL PROTECTED]

Yes, session_start() is called in another page. I store the session
data string in a local database and pass the session ID from page to
page. 

I should note that I've used these scripts with no problems for MONTHS,
I began experiencing crashes yesterday, for no reason I can identify,
and it's been all downhill from there.

------------------------------------------------------------------------

[2002-10-12 19:49:26] [EMAIL PROTECTED]

Did you initialize a session by calling session_start() before calling
session_decode() ?

------------------------------------------------------------------------

[2002-10-12 18:51:03] [EMAIL PROTECTED]

This is probably related to the issue described in
http://bugs.php.net/bug.php?id=19877. 

In 4CVs-2002-10-12 session_decode() appears to be non-functional. The
function simply does nothing - no values are returned and no variables
are set. I have verified that I'm passing the function a properly
formatted session data string. 

register_globals is on. Here's my configure line:
./configure --with-mysql --with-apache=/root/apache_1.3.27
--enable-track-vars --enable-trans-sid --enable-sigchild --enable-ftp
--enable-debug --enable-sockets

I'm using the CVS version because I was experiencing the session_decode
crash bug with version 4.2.x (see previous bug report - URL given
above). Perhaps these two issues are related?

------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=19882&edit=1

Reply via email to