I have an object which is holding the state for specific user... I need this object to be aviable while the user in on one of the pages in my site.
My question is, where to save this object?
Database? => to many queries... To build the state object many queries needs to be performed... and the object must be rebuilt for each page...
SESSION? => read the object from the database and store it in $_SESSION. But each time the user swich page the object is serialized and deserialized... this affects the page loading time because the object serialization is heavy function....
COOKIE? => I need to access the state object from the server...
Is there any other option?
What is the common approach in this case?