Zend Framework  1.12
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
Zend_Http_Header_SetCookie Class Reference

Public Member Functions

 __construct ($name=null, $value=null, $expires=null, $path=null, $domain=null, $secure=false, $httponly=false, $maxAge=null, $version=null)
 Cookie object constructor.
 
 getFieldName ()
 
 getFieldValue ()
 
 setName ($name)
 
 getName ()
 
 setValue ($value)
 
 getValue ()
 
 setVersion ($version)
 Set version.
 
 getVersion ()
 Get version.
 
 setMaxAge ($maxAge)
 Set Max-Age.
 
 getMaxAge ()
 Get Max-Age.
 
 setExpires ($expires)
 
 getExpires ($inSeconds=false)
 
 setDomain ($domain)
 
 getDomain ()
 
 setPath ($path)
 
 getPath ()
 
 setSecure ($secure)
 
 isSecure ()
 
 setHttponly ($httponly)
 
 isHttponly ()
 
 isExpired ($now=null)
 Check whether the cookie has expired.
 
 isSessionCookie ()
 Check whether the cookie is a session cookie (has no expiry time set)
 
 isValidForRequest ($requestDomain, $path, $isSecure=false)
 
 toString ()
 
 __toString ()
 
 toStringMultipleHeaders (array $headers)
 

Static Public Member Functions

static fromString ($headerLine, $bypassHeaderFieldName=false)
 Generate a new Cookie object from a cookie string (for example the value of the Set-Cookie HTTP header)
 

Protected Attributes

 $name = null
 
 $value = null
 
 $version = null
 
 $maxAge = null
 
 $expires = null
 
 $domain = null
 
 $path = null
 
 $secure = null
 
 $httponly = null
 

Constructor & Destructor Documentation

__construct (   $name = null,
  $value = null,
  $expires = null,
  $path = null,
  $domain = null,
  $secure = false,
  $httponly = false,
  $maxAge = null,
  $version = null 
)

Cookie object constructor.

Todo:
Add validation of each one of the parameters (legal domain, etc.)
Parameters
string$name
string$value
int$expires
string$path
string$domain
bool$secure
bool$httponly
string$maxAge
int$version
Returns
SetCookie

Member Function Documentation

__toString ( )
static fromString (   $headerLine,
  $bypassHeaderFieldName = false 
)
static

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

Exceptions
Zend_Http_Header_Exception_InvalidArgumentException
Parameters
$headerLine
bool$bypassHeaderFieldName
Returns
array|SetCookie
getDomain ( )
Returns
string
getExpires (   $inSeconds = false)
Returns
int
getFieldName ( )
Returns
string 'Set-Cookie'
getFieldValue ( )
getMaxAge ( )

Get Max-Age.

Returns
integer
getName ( )
Returns
string
getPath ( )
Returns
string
getValue ( )
Returns
string
getVersion ( )

Get version.

Returns
integer
isExpired (   $now = null)

Check whether the cookie has expired.

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

Parameters
int$nowTimestamp to consider as "now"
Returns
boolean
isHttponly ( )
Returns
bool
isSecure ( )
Returns
boolean
isSessionCookie ( )

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

Returns
boolean
isValidForRequest (   $requestDomain,
  $path,
  $isSecure = false 
)
setDomain (   $domain)
Parameters
string$domain
setExpires (   $expires)
Parameters
int$expires
Returns
SetCookie
setHttponly (   $httponly)
Parameters
bool$httponly
setMaxAge (   $maxAge)

Set Max-Age.

Parameters
integer$maxAge
setName (   $name)
Parameters
string$name
Returns
SetCookie
setPath (   $path)
Parameters
string$path
setSecure (   $secure)
Parameters
boolean$secure
setValue (   $value)
Parameters
string$value
setVersion (   $version)

Set version.

Parameters
integer$version
toString ( )
toStringMultipleHeaders ( array  $headers)

Member Data Documentation

$domain = null
protected
$expires = null
protected
$httponly = null
protected
$maxAge = null
protected
$name = null
protected
$path = null
protected
$secure = null
protected
$value = null
protected
$version = null
protected