PHP Class Symfony\Component\BrowserKit\Cookie

Author: Fabien Potencier ([email protected])
Datei anzeigen Open project: pmjones/php-framework-benchmarks Class Usage Examples

Protected Properties

Property Type Description
$domain
$expires
$httponly
$name
$path
$rawValue
$secure
$value

Public Methods

Method Description
__construct ( string $name, string $value, string $expires = null, string $path = null, string $domain = '', boolean $secure = false, boolean $httponly = true, boolean $encodedValue = false ) Sets a cookie.
__toString ( ) : string Returns the HTTP representation of the Cookie.
fromString ( string $cookie, string $url = null ) : Cookie Creates a Cookie instance from a Set-Cookie header value.
getDomain ( ) : string Gets the domain of the cookie.
getExpiresTime ( ) : string Gets the expires time of the cookie.
getName ( ) : string Gets the name of the cookie.
getPath ( ) : string Gets the path of the cookie.
getRawValue ( ) : string Gets the raw value of the cookie.
getValue ( ) : string Gets the value of the cookie.
isExpired ( ) : boolean Returns true if the cookie has expired.
isHttpOnly ( ) : boolean Returns the httponly flag of the cookie.
isSecure ( ) : boolean Returns the secure flag of the cookie.

Private Methods

Method Description
parseDate ( $dateValue )

Method Details

__construct() public method

Sets a cookie.
public __construct ( string $name, string $value, string $expires = null, string $path = null, string $domain = '', boolean $secure = false, boolean $httponly = true, boolean $encodedValue = false )
$name string The cookie name
$value string The value of the cookie
$expires string The time the cookie expires
$path string The path on the server in which the cookie will be available on
$domain string The domain that the cookie is available
$secure boolean Indicates that the cookie should only be transmitted over a secure HTTPS connection from the client
$httponly boolean The cookie httponly flag
$encodedValue boolean Whether the value is encoded or not

__toString() public method

Returns the HTTP representation of the Cookie.
public __toString ( ) : string
return string The HTTP representation of the Cookie

fromString() public static method

Creates a Cookie instance from a Set-Cookie header value.
public static fromString ( string $cookie, string $url = null ) : Cookie
$cookie string A Set-Cookie header value
$url string The base URL
return Cookie A Cookie instance

getDomain() public method

Gets the domain of the cookie.
public getDomain ( ) : string
return string The cookie domain

getExpiresTime() public method

Gets the expires time of the cookie.
public getExpiresTime ( ) : string
return string The cookie expires time

getName() public method

Gets the name of the cookie.
public getName ( ) : string
return string The cookie name

getPath() public method

Gets the path of the cookie.
public getPath ( ) : string
return string The cookie path

getRawValue() public method

Gets the raw value of the cookie.
public getRawValue ( ) : string
return string The cookie value

getValue() public method

Gets the value of the cookie.
public getValue ( ) : string
return string The cookie value

isExpired() public method

Returns true if the cookie has expired.
public isExpired ( ) : boolean
return boolean true if the cookie has expired, false otherwise

isHttpOnly() public method

Returns the httponly flag of the cookie.
public isHttpOnly ( ) : boolean
return boolean The cookie httponly flag

isSecure() public method

Returns the secure flag of the cookie.
public isSecure ( ) : boolean
return boolean The cookie secure flag

Property Details

$domain protected_oe property

protected $domain

$expires protected_oe property

protected $expires

$httponly protected_oe property

protected $httponly

$name protected_oe property

protected $name

$path protected_oe property

protected $path

$rawValue protected_oe property

protected $rawValue

$secure protected_oe property

protected $secure

$value protected_oe property

protected $value