I'm using the Zend HTTP client to implement a web client for communicating with a third-party service. I was thinking about making it a singleton pattern so each call could take advantage of using cookies from the service, so that we wouldn't need to re-login every time we instantiate a new version of the client.
The client will have multiple classes communicating with it, possibly from several different locations in code trying all at once. I'm worried that having a singleton client will cause race conditions when multiple entities try to use it at once.
Will this be an issue with the singleton pattern in a PHP HTTP client? If so, is there any other way to have the benefit of a Zend HTTP client that can store and use cookies across multiple transactions without having these issues?