CodeIgniter Forums
Object in CI Session - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Object in CI Session (/showthread.php?tid=8129)



Object in CI Session - El Forum - 05-06-2008

[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?


Object in CI Session - El Forum - 05-07-2008

[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.


Object in CI Session - El Forum - 05-07-2008

[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.