#3974 [Com]: Object properties produce unexpected results upon registering them to a session

From: Date: Tue, 01 Apr 2003 08:03:41 +0000
Subject: #3974 [Com]: Object properties produce unexpected results upon registering them to a session
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-36895@lists.php.net to get a copy of this message
ID: 3974 Comment by: chelseak at mail dot bg Reported By: seth at subimage dot com Status: Closed Bug Type: Session related Operating System: Redhat Linux 6.1 PHP Version: 4.0 Release Candidate 1 New Comment: ArtsKey v4.1 ser. # & crack Previous Comments: ------------------------------------------------------------------------ [2003-04-01 02:03:06] chelseak at mail dot bg ArtsKey v4.1 ser. # & crack ------------------------------------------------------------------------ [2000-07-06 08:53:13] sas at cvs dot php dot net Please upgrade to the latest PHP release. If the problem persists, try to create a short testcase and submit a new bug report. ------------------------------------------------------------------------ [2000-03-29 22:55:09] seth at subimage dot com When I create an instance of an object, register it to the session, and access it's properties from that page, all appear fine. After going to the next page, starting the session, and trying to read properties, they either don't appear or come back with values from _other_ variables!!! In this instance, sometimes I get back nothing on the second page for the variable $auth->id, but sometimes I get the value of $user!!! Classfile... class Auth { // properties var $classname = "Auth"; var $lifetime = 0; var $id = ""; var $md5pass = ""; var $sharedValue = ""; var $auth = false; var $crack = ""; function Auth() { $this->sharedValue = md5(uniqid(rand())); } function setcrack($crack) { $this->crack = $crack; } function setid($id) { $this->id = $id; } } first page... include("class/auth.php"); session_start(); $auth = new Auth(); $auth->setcrack("crack!"); $auth->setid("this is the auth user"); session_register("auth"); (note, the html on this page has 2 input boxes, "user" and "password") second page... --php-- require("class/auth.php"); session_start(); $results = $auth->validate($user, $password); --php-- client pass: <?= $clientPassword ?> <br> server pass: <?= $serverPassword ?> <br> user id: <?= $user ?> <br> password: <?= $password ?> <br> shared value: <?= $auth->sharedValue ?> <br> results: <?= $results ?> <br> authcrack: <?= $auth->crack ?> <br> authuser: <?= $auth->id ?> <br> authauth: <? $auth->auth ?> ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=3974&edit=1

« previous php.bugs (#36895) next »