Jump to content

incomplete object


MarioApprentice

Recommended Posts

Hey, everybody. I have a problem with session and an object. This is the deal.

 

I'm writing a forum for exercise. Now doing a login/logout script/part of the forum. The script knows that the user is logged in via a session variable that, when set and filled with a certain value, allows a registered user to log in.

When someone tries to login, i check in mysql table if his nick and passwords are there. If they are there, i summon another function that gets all of the data about that user and stores it in an object. I then store that object into a session in order to get the users data in another script.

After the object has been made all all the user data stored in it and after that object is stored in a session, I then route the program to index.php who then evaluates is the session is set and checks its value. Then it calls antoher function that has to use the object stored in that session. for example...

 

$_SESSION['member_object']->getValue('name')

 

fetches the name of the user. But here comes the problem. I get a fatal error like this...

 

"The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "Member" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide a __autoload() function..."

 

I presume this says that 'member_object' is not an object, which I checked with is_object() and it really is not an object. I did a require() on the script that has the class that the object was made of, but with no success. I also checked if the object is made in the login.php script and all the information are there which is the main problem. The script then goes to index.php with the header() function, and uses that session where the object is. But there, that object isn't constructed. It's not even an object.

 

I know this is a long question and i probably didn't give enough information to go on, but its a big application and i can't risk of explaining it all so no one will answer. Also, i think it would be rude of me so if anyone knows what this could be, I thank you in andvance.

Edited by MarioApprentice
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.