[PHP-DEV] PHP 4.0 Bug #7980: set object as session variable From: alexm <email protected>
Date: 11/26/00

From: alexm <email protected>
Operating system: RedHat 6.1
PHP version: 4.0.3pl1
PHP Bug Type: Class/Object related
Bug description: set object as session variable

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

-- 
Edit Bug report at: http://bugs.php.net/?id=7980&edit=1

-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>