Bug #17419 Updated: Complex objects not correctly stored in ssession
| From: | wdseelig at ncms dot org | Date: | Mon, 27 May 2002 02:13:08 +0000 |
| Subject: | Bug #17419 Updated: Complex objects not correctly stored in ssession | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-8637@lists.php.net to get a copy of this message | ||
ID: 17419
Updated by: wdseelig@ncms.org
Reported By: wseelig@ncms.org
Status: Feedback
Bug Type: Session related
Operating System: Apache
PHP Version: 4.2.1
New Comment:
OK -- I have tried to telnet to the domain and cannot do that either.
Here is the URL:
http://sql.wash-gop.com/wyck/WebSiteII/html/simpleclass.php
Previous Comments:
------------------------------------------------------------------------
[2002-05-26 12:04:35] sander@php.net
You don't need telnet access for this. Just telnet from your local box
to the webserver, i.e.
telnet www.yourdomain.com 80
Alternatively, post an url of that page here (or mail it me, if you
prefer to keep it private) and I'll see what I can do.
------------------------------------------------------------------------
[2002-05-26 08:20:25] wdseelig@ncms.org
I am developing on a web server to which I do not normally have telnet
privileges, but I will ask them if they can open this up to me.
I apologize for putting Apache rather than the OS. I'll get that for
you as soon as I can -- it is BSD something.
Thank you for looking at this!
Wyckham
------------------------------------------------------------------------
[2002-05-25 04:41:22] sander@php.net
Can you gice us some real error message instead of the junk you're
browser is giving you? Can you try to telnet'ing manually to your
webserver and give us the HTTP response?
Also, Apache is not an OS. Please update the field above.
------------------------------------------------------------------------
[2002-05-24 16:47:42] wseelig@ncms.org
Complex objects are not correctly stored in a session. This report is
similar to 8676, which was reported fixed. It now appears to be broken
in 4.2.1.
Here is a code scriplet to demonstrate the problem:
<?
class Alpha
{
var $alpha1;
var $betavar;
function Alpha()
{
$this->betavar =& new Beta(&$this); //Let Beta use Alpha's methods
and properties
$this->alpha1 = 22;
}
function getvar()
{
return $this->alpha1;
}
}
class Beta
{
var $beta1;
var $alphacall;
function Beta(&$par)
{
$this->alphacall = &$par; //alphacall will let Beta use Alpha's
methods and properties
$this->beta1 = 5;
}
function getalphavar()
{
print("<br>The value of the alphavar from within Beta is: " .
$this->alphacall->alpha1 );
}
}
session_start();
if (! session_is_registered("pm") )
{
session_register("pm"); // register and instantiate the variable
$pm =& new Alpha();
}
print("<br>The vaue of alpha1 is: " . $pm->getvar() );
print("<br>The value of beta1 is: " . $pm->betavar->beta1);
print("<br>" . $pm->betavar->getalphavar() );
?>
OBSERVED BEHAVIOR:
When this page is loaded the first time, everything works as expected,
and the
values of alpha1, and beta 1 print out just fine. However, attempts
to refresh the page yield a browser error message "This page cannot be
displayed".
This structure worked (flakily) on 4.04pi1, and I was hoping that the
fix of 8676 would
have made it solid in 4.2.1. However, the situation is now worse--the
above structure
NEVER works.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=17419&edit=1