php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #3974 Object properties produce unexpected results upon registering them to a session
Submitted: 2000-03-29 22:55 UTC Modified: 2000-07-06 08:53 UTC
From: seth at subimage dot com Assigned:
Status: Closed Package: Session related
PHP Version: 4.0 Release Candidate 1 OS: Redhat Linux 6.1
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: seth at subimage dot com
New email:
PHP Version: OS:

 

 [2000-03-29 22:55 UTC] 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 ?>

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-07-06 08:53 UTC] 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.
 [2003-04-01 02:03 UTC] chelseak at mail dot bg
ArtsKey v4.1 ser. # & crack
 [2003-04-01 02:03 UTC] chelseak at mail dot bg
ArtsKey v4.1 ser. # & crack
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Mon Aug 15 01:05:44 2022 UTC