/**
* Returns the cookie collection.
* The cookie collection contains the cookies associated with HTTP message.
* @return CookieCollection|Cookie[] the cookie collection.
*/
public function getCookies()
{
if (!is_object($this->_cookies)) {
$cookieCollection = new CookieCollection();
if (is_array($this->_cookies)) {
foreach ($this->_cookies as $cookie) {
if (!is_object($cookie)) {
$cookie = new Cookie($cookie);
}
$cookieCollection->add($cookie);
}
}
$this->_cookies = $cookieCollection;
}
return $this->_cookies;
}