|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #9194 Objects not properly stored as session variables
Submitted: 2001-02-09 11:00 UTC Modified: 2001-04-16 05:27 UTC
From: ltning at anduin dot net Assigned: andre (profile)
Status: Closed Package: Class/Object related
PHP Version: 4.0.4pl1 OS: Slackware Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
40 - 11 = ?
Subscribe to this entry?

 [2001-02-09 11:00 UTC] ltning at anduin dot net
Look at for sourcecode of failing page. to test, use test/test as username/password.

Bug is as follows:
I define the class "user", call session_start(), create an instance of the object called $currentuser, register this variable using session_register() (i tried doing this both before and after the instancination). Upon creating, the object sets some internal variables in its constructor, like "fullname".
When loading the page again, having the session-id in PHPSESSID, the object shows up as existing, but trying to call a method or view a property fails with the message:
Fatal error: The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition user of the object you are trying to operate on was loaded _before_ the session was started in /home/ltning/webmail2/index.php on line 34

I see this bug has been reported before and considered fixed, but it doesn't seem to be. Running latest (4.04pl1) PHP.

best regards,
Eirik Overby


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-02-20 00:44 UTC]
Please provide a reduced code fragment (<15 lines) producing
this behaviour.
Put no database queries etc. in it and rely on no external
files/functions to ensure that we can reproduce it easily
unless the problem is not directly related to some db (or
similar) function.
 [2001-04-16 05:27 UTC]
Please provide code and reopen bug report. This bug report is getting old and has been waiting for your reduced code fragment for over a month.

- James
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Feb 23 08:01:29 2024 UTC