PHP 클래스 Neos\Flow\Http\Cookie

또한 보기: http://tools.ietf.org/html/rfc6265
파일 보기 프로젝트 열기: neos/flow-development-collection 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$domain string Hosts to which this cookie will be sent (RFC 6265, 4.1.2.3)
$expiresTimestamp integer Unix timestamp of the expiration date / time or 0 for "session" expiration (RFC 6265, 4.1.2.1)
$httpOnly boolean
$maximumAge integer Number of seconds until the cookie expires (RFC 6265, 4.1.2.2)
$name string Cookie Name, a token (RFC 6265, 4.1.1)
$path string
$secure boolean
$value string

공개 메소드들

메소드 설명
__construct ( string $name, mixed $value = null, integer | DateTime $expires, integer $maximumAge = null, string $domain = null, string $path = '/', boolean $secure = false, boolean $httpOnly = true ) Constructs a new Cookie object
__toString ( ) : string Renders the field value suitable for a HTTP "Set-Cookie" header.
createFromRawSetCookieHeader ( string $header ) : Cookie Creates a cookie (an instance of this class) by a provided raw header string like "foo=507d9f20317a5; path=/; domain=.example.org" This is is an implementation of the algorithm explained in RFC 6265, Section 5.2 A basic statement of this algorithm is to "ignore the set-cookie-string entirely" in case a required condition is not met. In these cases this function will return NULL rather than the created cookie.
expire ( ) : void Marks this cookie for removal.
getDomain ( ) : string Returns the domain this cookie is valid for.
getExpires ( ) : integer Returns the date and time of the Expires attribute, if any.
getMaximumAge ( ) : integer Returns the number of seconds until the cookie expires, if defined.
getName ( ) : string Returns the name of this cookie
getPath ( ) : string Returns the path this cookie is valid for.
getValue ( ) : mixed Returns the value of this cookie
isExpired ( ) : boolean Tells if this cookie is expired and will be removed in the user agent when it received the response containing this cookie.
isHttpOnly ( ) : boolean Tells if this cookie should only be used through the HTTP protocol.
isSecure ( ) : boolean Tells if the cookie was flagged to be sent over "secure" channels only.
setValue ( mixed $value ) : void Sets the value of this cookie

메소드 상세

__construct() 공개 메소드

Constructs a new Cookie object
public __construct ( string $name, mixed $value = null, integer | DateTime $expires, integer $maximumAge = null, string $domain = null, string $path = '/', boolean $secure = false, boolean $httpOnly = true )
$name string The cookie name as a valid token (RFC 2616)
$value mixed The value to store in the cookie. Must be possible to cast into a string.
$expires integer | DateTime Date and time after which this cookie expires.
$maximumAge integer Number of seconds until the cookie expires.
$domain string The host to which the user agent will send this cookie
$path string The path describing the scope of this cookie
$secure boolean If this cookie should only be sent through a "secure" channel by the user agent
$httpOnly boolean If this cookie should only be used through the HTTP protocol

__toString() 공개 메소드

Renders the field value suitable for a HTTP "Set-Cookie" header.
public __toString ( ) : string
리턴 string

createFromRawSetCookieHeader() 공개 정적인 메소드

Creates a cookie (an instance of this class) by a provided raw header string like "foo=507d9f20317a5; path=/; domain=.example.org" This is is an implementation of the algorithm explained in RFC 6265, Section 5.2 A basic statement of this algorithm is to "ignore the set-cookie-string entirely" in case a required condition is not met. In these cases this function will return NULL rather than the created cookie.
또한 보기: http://tools.ietf.org/html/rfc6265
public static createFromRawSetCookieHeader ( string $header ) : Cookie
$header string The Set-Cookie string without the actual "Set-Cookie:" part
리턴 Cookie

expire() 공개 메소드

On executing this method, the expiry time of this cookie is set to a point in time in the past triggers the removal of the cookie in the user agent.
public expire ( ) : void
리턴 void

getDomain() 공개 메소드

Returns the domain this cookie is valid for.
public getDomain ( ) : string
리턴 string The domain name

getExpires() 공개 메소드

Note that this date / time is returned as a unix timestamp, no matter what the format was originally set through the constructor of this Cookie. The special case "no expiration time" is returned in form of a zero value.
public getExpires ( ) : integer
리턴 integer A unix timestamp or 0

getMaximumAge() 공개 메소드

This information is rendered as the Max-Age attribute (RFC 6265, 4.1.2.2). Note that not all browsers support this attribute.
public getMaximumAge ( ) : integer
리턴 integer The maximum age in seconds, or NULL if none has been defined.

getName() 공개 메소드

Returns the name of this cookie
public getName ( ) : string
리턴 string The cookie name

getPath() 공개 메소드

Returns the path this cookie is valid for.
public getPath ( ) : string
리턴 string The path

getValue() 공개 메소드

Returns the value of this cookie
public getValue ( ) : mixed
리턴 mixed

isExpired() 공개 메소드

Tells if this cookie is expired and will be removed in the user agent when it received the response containing this cookie.
public isExpired ( ) : boolean
리턴 boolean True if this cookie is expired

isHttpOnly() 공개 메소드

Tells if this cookie should only be used through the HTTP protocol.
public isHttpOnly ( ) : boolean
리턴 boolean State of the "HttpOnly" attribute

isSecure() 공개 메소드

This security measure only has a limited effect. Please read RFC 6265 Section 8.6 for more details.
public isSecure ( ) : boolean
리턴 boolean State of the "Secure" attribute

setValue() 공개 메소드

Sets the value of this cookie
public setValue ( mixed $value ) : void
$value mixed The new value
리턴 void

프로퍼티 상세

$domain 보호되어 있는 프로퍼티

Hosts to which this cookie will be sent (RFC 6265, 4.1.2.3)
protected string $domain
리턴 string

$expiresTimestamp 보호되어 있는 프로퍼티

Unix timestamp of the expiration date / time or 0 for "session" expiration (RFC 6265, 4.1.2.1)
protected int $expiresTimestamp
리턴 integer

$httpOnly 보호되어 있는 프로퍼티

protected bool $httpOnly
리턴 boolean

$maximumAge 보호되어 있는 프로퍼티

Number of seconds until the cookie expires (RFC 6265, 4.1.2.2)
protected int $maximumAge
리턴 integer

$name 보호되어 있는 프로퍼티

Cookie Name, a token (RFC 6265, 4.1.1)
protected string $name
리턴 string

$path 보호되어 있는 프로퍼티

protected string $path
리턴 string

$secure 보호되어 있는 프로퍼티

protected bool $secure
리턴 boolean

$value 보호되어 있는 프로퍼티

protected string $value
리턴 string