Zend_Http_Client is an implementation of an HTTP client in PHP. The client supports basic features like sending different HTTP requests and handling redirections, as well as more advanced features like proxy settings, HTTP authentication and cookie persistence (using a Zend_Http_CookieJar object)

todo Implement proxy settings
category Zend
package Zend_Http
subpackage Header
copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
license New BSD License

 Methods

Cookie object constructor

__construct(string $name = null, string $value = null, integer $expires = null, string $path = null, string $domain = null, boolean $secure = false, boolean $httponly = false, string $maxAge = null, integer $version = null) : \SetCookie
todo Add validation of each one of the parameters (legal domain, etc.)

Parameters

$name

string

$value

string

$expires

integer

$path

string

$domain

string

$secure

boolean

$httponly

boolean

$maxAge

string

$version

integer

Returns

\SetCookie

__toString()

__toString() 

Generate a new Cookie object from a cookie string (for example the value of the Set-Cookie HTTP header)

fromString($headerLine, boolean $bypassHeaderFieldName = false) : array | \SetCookie
Static
static

Parameters

$headerLine

$bypassHeaderFieldName

boolean

Exceptions

\Zend_Http_Header_Exception_InvalidArgumentException

Returns

array\SetCookie

getDomain()

getDomain() : string

Returns

string

getExpires()

getExpires($inSeconds = false) : integer

Parameters

$inSeconds

Returns

integer

getFieldName()

getFieldName() : string

Returns

string'Set-Cookie'

getFieldValue()

getFieldValue() : string

Exceptions

\Zend_Http_Header_Exception_RuntimeException

Returns

string

Get Max-Age

getMaxAge() : integer

Returns

integer

getName()

getName() : string

Returns

string

getPath()

getPath() : string

Returns

string

getValue()

getValue() : string

Returns

string

Get version

getVersion() : integer

Returns

integer

Check whether the cookie has expired

isExpired(integer $now = null) : boolean

Always returns false if the cookie is a session cookie (has no expiry time)

Parameters

$now

integer

Timestamp to consider as "now"

Returns

boolean

isHttponly()

isHttponly() : boolean

Returns

boolean

isSecure()

isSecure() : boolean

Returns

boolean

Check whether the cookie is a session cookie (has no expiry time set)

isSessionCookie() : boolean

Returns

boolean

isValidForRequest()

isValidForRequest($requestDomain, $path, $isSecure = false

Parameters

$requestDomain

$path

$isSecure

setDomain()

setDomain(string $domain) 

Parameters

$domain

string

setExpires()

setExpires(integer $expires) : \SetCookie

Parameters

$expires

integer

Returns

\SetCookie

setHttponly()

setHttponly(boolean $httponly) 

Parameters

$httponly

boolean

Set Max-Age

setMaxAge(integer $maxAge) 

Parameters

$maxAge

integer

setName()

setName(string $name) : \SetCookie

Parameters

$name

string

Returns

\SetCookie

setPath()

setPath(string $path) 

Parameters

$path

string

setSecure()

setSecure(boolean $secure) 

Parameters

$secure

boolean

setValue()

setValue(string $value) 

Parameters

$value

string

Set version

setVersion(integer $version) 

Parameters

$version

integer

toString()

toString() 

toStringMultipleHeaders()

toStringMultipleHeaders(array $headers) 

Parameters

$headers

 Properties

 

Cookie domain

$domain : string

Default

null
 

Cookie expiry date

$expires : integer

Default

null
 

$httponly

$httponly : true

Default

null
 

Max Age

$maxAge : integer

Default

null
 

Cookie name

$name : string

Default

null
 

Cookie path

$path : string

Default

null
 

Whether the cookie is secure or not

$secure : boolean

Default

null
 

Cookie value

$value : string

Default

null
 

Version

$version : integer

Default

null