One way is to serialize the object and then put it in a file or database to share it between requests. However, if two requests are executed exactly at the same time, each of them will have a different object for work, and the last request will be the only one that will be saved. Therefore, to prevent this, you will need some kind of locking mechanism.
http://ca.php.net/manual/en/function.serialize.php
source share