CodeIgniter Forums

Full Version: Object in CI Session
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]danolsen[/eluser]
I am trying to implement Google checkout in my CI project. I want to persist a Cart object in the session. However, when I add the object to the session and try to access it later I get a __PHP_Incomplete_Class Object. Has anyone else run into this and know how I might be able to get around it?

El Forum

[eluser]Vince Stross[/eluser]
Can you post some code?

I'm not familiar with Google checkout and your cart setup but would it be possible to store your data as an array instead of an object? I always work with array's in the session but it's been awhile since I used an object. I know it's possible because I'm sure I've done it before, but I moved to arrays a while ago since they're supposedly faster.

If you can post some sample of your code that would be really helpful, otherwise - no, nothing comes to mind.

El Forum

[eluser]danolsen[/eluser]
[quote author="Ishmael" date="1210178498"]Can you post some code?

I'm not familiar with Google checkout and your cart setup but would it be possible to store your data as an array instead of an object? [/quote]

I am using the Google Checkout PHP libraries which has you create a Cart object to add items to. I want to store that Cart object into the session.