Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.
Zend_Http_Cookie is a class describing an HTTP cookie and all it's parameters.
Zend_Http_Cookie is a class describing an HTTP cookie and all it's parameters. The class also enables validating whether the cookie should be sent to the server in a specified scenario according to the request URI, the expiry time and whether session cookies should be used or not. Generally speaking cookies should be contained in a Cookiejar object, or instantiated manually and added to an HTTP request.
See http://wp.netscape.com/newsref/std/cookie_spec.html for some specs.
string $domain = ''Cookie domain
Detailsboolean $encodeValue = ''Whether the cookie value has been encoded/decoded
Detailsint $expires = ''Cookie expiry date
Detailsstring $name = ''Cookie name
Detailsstring $path = ''Cookie path
Detailsboolean $secure = ''Whether the cookie is secure or not
Detailsstring $value = ''Cookie value
Details__construct(
string $name, string $value, string $domain, int $expires
=
null, string $path
=
null, bool $secure
=
false
)
:
Cookie object constructor
Details__toString(
)
:
stringGet the cookie as a string, suitable for sending as a "Cookie" header in an HTTP request
DetailsfromString(
string $cookieStr, Zend_Uri_Http|string $refUri
=
null, boolean $encodeValue
=
true
)
:
Zend_Http_CookieGenerate a new Cookie object from a cookie string (for example the value of the Set-Cookie HTTP header)
DetailsgetDomain(
)
:
stringGet cookie domain
DetailsgetExpiryTime(
)
:
int|nullGet the expiry time of the cookie, or null if no expiry time is set
DetailsgetName(
)
:
stringGet Cookie name
DetailsgetPath(
)
:
stringGet the cookie path
DetailsgetValue(
)
:
stringGet cookie value
DetailsisExpired(
int $now
=
null
)
:
booleanCheck whether the cookie has expired
Always returns false if the cookie is a session cookie (has no expiry time)
DetailsisSecure(
)
:
booleanCheck whether the cookie should only be sent over secure connections
DetailsisSessionCookie(
)
:
booleanCheck whether the cookie is a session cookie (has no expiry time set)
Detailsmatch(
string|Zend_Uri_Http $uri, boolean $matchSessionCookies
=
true, int $now
=
null
)
:
booleanChecks whether the cookie should be sent or not in a specific scenario
DetailsmatchCookieDomain(
string $cookieDomain, string $host
)
:
booleanCheck if a cookie's domain matches a host name.
Used by Zend_Http_Cookie and Zend_Http_CookieJar for cookie matching
DetailsmatchCookiePath(
string $cookiePath, string $path
)
:
booleanCheck if a cookie's path matches a URL path
Used by Zend_Http_Cookie and Zend_Http_CookieJar for cookie matching
Details