php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #7980 set object as session variable
Submitted: 2000-11-26 18:40 UTC Modified: 2004-06-25 10:17 UTC
From: alexm at xanthus dot net Assigned:
Status: Not a bug Package: Class/Object related
PHP Version: 4.0.3pl1 OS: RedHat 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: alexm at xanthus dot net
New email:
PHP Version: OS:

 

 [2000-11-26 18:40 UTC] alexm at xanthus dot net
i wrote an object definition(class session) in which i implemented all assesor/mutator methods i need on some vars in the object.

in auto_header.php script i have following logic:

if (!isset($session)) {
    $session = new Session(session_id());
    session_register("session");
} else {
    if ($session->isValid()) {
          echo("session is valid!");
    } else { 
          echo("session has expired!");
    }//esle
}//esle

i also require class definition and constants definition files in the beggining of the script.

php engine gives me Fatal Error on line #5[if ($session->isValid()) { ]. 
here is the full text: 
Fatal error: The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition session of the object you are trying to operate on was loaded _before_ the session was started

my hipothesis is that php doesn't have capabilities to save complex object as session vars.

anyone has any sugestions?

thx,
alex

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-06-06 09:26 UTC] mfischer@php.net
You are missing the class definition before you access the object, this is bogus.
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Wed Nov 20 11:01:30 2019 UTC