Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7526883
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T03:57:29+00:00 2026-05-30T03:57:29+00:00

Situation: It seems impossible to store any objects in the CI_Session since, reading them

  • 0

Situation: It seems impossible to store any objects in the CI_Session since, reading them results in the PHP_Incomplete_Object exceptions, as the session is always started, before loading the models.
This way, even when autoloading the Type of object, I am never able to read the data from the session.

I also tried using the “Native Session”, but there it’s exactly the same problem.

Furthermore I tried storing the object serialized, but when unserializing long after having all the models loaded, it still becomes an object with type “__PHP_Incomplete_Class “.

Anyone know a workaround? And please keep “why would you want an object in the session” answers. Seen enough of those …

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T03:57:31+00:00Added an answer on May 30, 2026 at 3:57 am

    Unfortunately, php does not allow you to serialize references to one object from another. This is why when you restore your object it does not contain the data it started with.

    The best solution I have come up with is to create a Session object in my model layer which is restored using a cookie. The session table in your database handles the references to the objects that you would otherwise have serialized. Once your Session model is loaded, you can use it to load the ‘session stored’ objects, eagerly or lazily.

    Further, should these objects hold references to other model objects you can use the same principle to traverse the rest of the model layer, based on the relational references. This can seem daunting, but there are a number of ORMs you could check out if you dont feel comfortable implementing it yourself.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've run into a strange situation that seems to involve long text overflowing. I'm
Situation I have been working on a project lately where the UI development seems
I have a problem that seems like its a result of a deadlock-situation. Whe
Situation: Site with content protected by username/password (not all controlled since they can be
OK, this is impossible, but I will try to explain the situation here. Let's
I just wondered how people were approaching this situation. It's something that seems like
I have an interesting situation that has me stumped. It seems that posting appliction/json
I have what seems like an odd situation here. I'm launching dialogs from a
There is a situation that I am faced with which seems like it has
I know its a very common question, but seems like my situation is a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.