|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2000-07-06 08:53 UTC] sas at cvs dot php dot net
[2003-04-01 02:03 UTC] chelseak at mail dot bg
[2003-04-01 02:03 UTC] chelseak at mail dot bg
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Dec 15 14:00:01 2025 UTC |
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 ?>