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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Serialise objects in Session 1

Status
Not open for further replies.

Naoise

Programmer
Dec 23, 2004
318
IE
What is the advantage of serialising an object in a session if the session can hold an object irrespective?
 
sessions variables are implicitly serialised when a session is closed, and deserialised when opened.

if you assign an object to a session variable, you need to make the object known to php before starting the session.

if this is impossible (because you use session auto start or similar) it can be useful manually to serialise an object before assigning it to a session variable. then you can manually deserialise it once you have instantiated a new object reference in your code.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top