Http/Header/SetCookie.php

Show: PublicProtectedPrivateinherited
Table of Contents
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
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

>VPropertyprotectedstring $domain = null
Cookie domain
Default valuenullDetails
Type
string
>VPropertyprotectedint $expires = null
Cookie expiry date
Default valuenullDetails
Type
int
>VPropertyprotectedtrue $httponly = null
Default valuenullDetails
Type
true
>VPropertyprotectedinteger $maxAge = null
Max Age
Default valuenullDetails
Type
integer
>VPropertyprotectedstring $name = null
Cookie name
Default valuenullDetails
Type
string
>VPropertyprotectedstring $path = null
Cookie path
Default valuenullDetails
Type
string
>VPropertyprotectedboolean $secure = null
Whether the cookie is secure or not
Default valuenullDetails
Type
boolean
>VPropertyprotectedstring $value = null
Cookie value
Default valuenullDetails
Type
string
>VPropertyprotectedinteger $version = null
Version
Default valuenullDetails
Type
integer

Methods

methodpublic__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
NameTypeDescription
$namestring
$valuestring
$expiresint
$pathstring
$domainstring
$securebool
$httponlybool
$maxAgestring
$versionint
Returns
TypeDescription
\SetCookie
Details
Todo
Add validation of each one of the parameters (legal domain, etc.)  
methodpublic__toString() : void

methodpublicfromString( $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
NameTypeDescription
$headerLine
$bypassHeaderFieldNamebool
Returns
TypeDescription
array | \SetCookie
Throws
ExceptionDescription
\Zend_Http_Header_Exception_InvalidArgumentException
Details
Static
 
methodpublicgetDomain() : string

Returns
TypeDescription
string
methodpublicgetExpires( $inSeconds = false) : int

Parameters
NameTypeDescription
$inSeconds
Returns
TypeDescription
int
methodpublicgetFieldName() : string

Returns
TypeDescription
string'Set-Cookie'
methodpublicgetFieldValue() : string

Returns
TypeDescription
string
Throws
ExceptionDescription
\Zend_Http_Header_Exception_RuntimeException
methodpublicgetMaxAge() : integer

Get Max-Age

Returns
TypeDescription
integer
methodpublicgetName() : string

Returns
TypeDescription
string
methodpublicgetPath() : string

Returns
TypeDescription
string
methodpublicgetValue() : string

Returns
TypeDescription
string
methodpublicgetVersion() : integer

Get version

Returns
TypeDescription
integer
methodpublicisExpired(int $now = null) : boolean

Check whether the cookie has expired

Always returns false if the cookie is a session cookie (has no expiry time)
Parameters
NameTypeDescription
$nowint

Timestamp to consider as "now"

Returns
TypeDescription
boolean
methodpublicisHttponly() : bool

Returns
TypeDescription
bool
methodpublicisSecure() : boolean

Returns
TypeDescription
boolean
methodpublicisSessionCookie() : boolean

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

Returns
TypeDescription
boolean
methodpublicisValidForRequest( $requestDomain,  $path,  $isSecure = false) : void

Parameters
NameTypeDescription
$requestDomain
$path
$isSecure
methodpublicsetDomain(string $domain) : void

Parameters
NameTypeDescription
$domainstring
methodpublicsetExpires(int $expires) : \SetCookie

Parameters
NameTypeDescription
$expiresint
Returns
TypeDescription
\SetCookie
methodpublicsetHttponly(bool $httponly) : void

Parameters
NameTypeDescription
$httponlybool
methodpublicsetMaxAge(integer $maxAge) : void

Set Max-Age

Parameters
NameTypeDescription
$maxAgeinteger
methodpublicsetName(string $name) : \SetCookie

Parameters
NameTypeDescription
$namestring
Returns
TypeDescription
\SetCookie
methodpublicsetPath(string $path) : void

Parameters
NameTypeDescription
$pathstring
methodpublicsetSecure(boolean $secure) : void

Parameters
NameTypeDescription
$secureboolean
methodpublicsetValue(string $value) : void

Parameters
NameTypeDescription
$valuestring
methodpublicsetVersion(integer $version) : void

Set version

Parameters
NameTypeDescription
$versioninteger
methodpublictoString() : void

methodpublictoStringMultipleHeaders( $headers) : void

Parameters
NameTypeDescription
$headers
Documentation was generated by phpDocumentor 2.2.0 .