\Symfony\Component\HttpFoundationCookie

Represents a cookie.

Summary

Methods
Properties
Constants
__construct()
__toString()
getName()
getValue()
getDomain()
getExpiresTime()
getPath()
isSecure()
isHttpOnly()
isCleared()
No public properties found
No constants found
No protected methods found
$name
$value
$domain
$expire
$path
$secure
$httpOnly
N/A
No private methods found
No private properties found
N/A

Properties

$name

$name : 

Type

$value

$value : 

Type

$domain

$domain : 

Type

$expire

$expire : 

Type

$path

$path : 

Type

$secure

$secure : 

Type

$httpOnly

$httpOnly : 

Type

Methods

__construct()

__construct(string  $name, string  $value = null, integer|string|\DateTime  $expire, string  $path = '/', string  $domain = null, boolean  $secure = false, boolean  $httpOnly = true) 

Constructor.

Parameters

string $name

The name of the cookie

string $value

The value of the cookie

integer|string|\DateTime $expire

The time the cookie expires

string $path

The path on the server in which the cookie will be available on

string $domain

The domain that the cookie is available to

boolean $secure

Whether the cookie should only be transmitted over a secure HTTPS connection from the client

boolean $httpOnly

Whether the cookie will be made accessible only through the HTTP protocol

Throws

\InvalidArgumentException

__toString()

__toString() : string

Returns the cookie as a string.

Returns

string —

The cookie

getName()

getName() : string

Gets the name of the cookie.

Returns

string

getValue()

getValue() : string

Gets the value of the cookie.

Returns

string

getDomain()

getDomain() : string

Gets the domain that the cookie is available to.

Returns

string

getExpiresTime()

getExpiresTime() : integer

Gets the time the cookie expires.

Returns

integer

getPath()

getPath() : string

Gets the path on the server in which the cookie will be available on.

Returns

string

isSecure()

isSecure() : boolean

Checks whether the cookie should only be transmitted over a secure HTTPS connection from the client.

Returns

boolean

isHttpOnly()

isHttpOnly() : boolean

Checks whether the cookie will be made accessible only through the HTTP protocol.

Returns

boolean

isCleared()

isCleared() : boolean

Whether this cookie is about to be cleared.

Returns

boolean