Http/Header/SetCookie.php
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 [email protected] so we can send you a copy immediately.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Http
- Subpackage
- Header
- Version
- $Id$
\Zend_Http_Header_SetCookie
Package: Zend_Http\Header
Returns
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)
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Todo
- Implement proxy settings
Properties
Methods
__construct(string $name = null, string $value = null, int $expires = null, string $path = null, string $domain = null, bool $secure = false, bool $httponly = false, string $maxAge = null, int $version = null) : \SetCookie
Cookie object constructor
Parameters
Returns
Details
Name | Type | Description |
---|---|---|
$name | string | |
$value | string | |
$expires | int | |
$path | string | |
$domain | string | |
$secure | bool | |
$httponly | bool | |
$maxAge | string | |
$version | int |
Type | Description |
---|---|
\SetCookie |
- Todo
- Add validation of each one of the parameters (legal domain, etc.)
fromString( $headerLine, bool $bypassHeaderFieldName = false) : array | \SetCookie
static
Generate a new Cookie object from a cookie string (for example the value of the Set-Cookie HTTP header)
Parameters
Returns
Throws
Details
Name | Type | Description |
---|---|---|
$headerLine | ||
$bypassHeaderFieldName | bool |
Type | Description |
---|---|
array | \SetCookie |
Exception | Description |
---|---|
\Zend_Http_Header_Exception_InvalidArgumentException |
- Static
getExpires( $inSeconds = false) : int
Parameters
Returns
Name | Type | Description |
---|---|---|
$inSeconds |
Type | Description |
---|---|
int |
getFieldValue() : string
Returns
Throws
Type | Description |
---|---|
string |
Exception | Description |
---|---|
\Zend_Http_Header_Exception_RuntimeException |
isExpired(int $now = null) : boolean
Check whether the cookie has expired
Always returns false if the cookie is a session cookie (has no expiry time)
ParametersName | Type | Description |
---|---|---|
$now | int | Timestamp to consider as "now" |
Type | Description |
---|---|
boolean |
isSessionCookie() : boolean
Check whether the cookie is a session cookie (has no expiry time set)
Returns
Type | Description |
---|---|
boolean |
isValidForRequest( $requestDomain, $path, $isSecure = false) : void
Parameters
Name | Type | Description |
---|---|---|
$requestDomain | ||
$path | ||
$isSecure |
setExpires(int $expires) : \SetCookie
Parameters
Returns
Name | Type | Description |
---|---|---|
$expires | int |
Type | Description |
---|---|
\SetCookie |
setName(string $name) : \SetCookie
Parameters
Returns
Name | Type | Description |
---|---|---|
$name | string |
Type | Description |
---|---|
\SetCookie |