Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Session var = object 1

Status
Not open for further replies.

Itshim

Programmer
Apr 6, 2004
277
US
I've read this thread from 2003: thread434-685282 which answers most of my questions. I noticed that in sleipnir's example when setting a session variable to an object, the information stored on the server is serialized.

I am still a little fuzzy about serialisation is needed. I see in the example that PHP automatically serializes and unserialises the data. So there is no need for me to program this, correct?

Thank you,
Itshim
 
That is correct. PHP automagically serializes anything put into a session store, so you do not have to write any code to do the serialization.




Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Thank you for the answer sleipnir. Just one last question...

I have created a child class of my session class, which handles storing and retrieving objects in a session. Currently, I have it setup to store all objects in one array. Everything is working as expected, but through testing I've noticed that the '$_SESSION['objects']' grows very quickly and I am little worried about hitting some sort of ceiling to the amount of data that can be stored in one $_SESSION variable. Is there a limit, or are my concerns unjustified?

Itshim
 
I'm sure there must be limits, but I do not know what they are. I've never hit any kind of limit and I've stored an awful lot in session variables before.

Want the best answers? Ask the best questions!

TANSTAAFL!!
 
an awful lot ?? I'm als obusy with sessionvariables in MYSQL and I was wondering that if I want to make my pages multilanguage if it's the best to store all the vars of the textobjects in the session or use include files for it ????
 
I wouldn't put the text necessary for internationalization into session variables. I would just put the user's preferred language into a session variable, then let the scripts output the correct text based on that preference. How you accomplish this programmatic switch of languages (include files, whathaveyou) is up to you.


Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top