How can i have user A and user B has the same instance of an object? I guess this would be across two different sessions.
TIA.
How can i have user A and user B has the same instance of an object? I guess this would be across two different sessions.
TIA.
One way would be to serialize the object and then putting it in a file or a database to share it between requests. However if two request happen exactly at the same time, they will each have a different object to work with and the last request to finish will be the only one that will be saved. So you will need some kind of locking mechanism prevent that.
Checkout APC,
http://www.php.net/manual/en/intro.apc.php
You can store the object to cache like this,
apc_store('my_key', $obj);
and retrieve from another page/session, like this,
$obj = apc_fetch('my_key');