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.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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 to prevent that.
http://ca.php.net/manual/en/function.serialize.php