PHP Класс Symfony\Component\HttpFoundation\Cookie

Автор: Johannes M. Schmitt ([email protected])
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$domain
$expire
$httpOnly
$name
$path
$secure
$value

Открытые методы

Метод Описание
__construct ( string $name, string | null $value = null, integer | string | DateTimeInterface $expire, string $path = '/', string | null $domain = null, boolean $secure = false, boolean $httpOnly = true, boolean $raw = false, string | null $sameSite = null ) Constructor.
__toString ( ) : string Returns the cookie as a string.
fromString ( string $cookie, boolean $decode = false ) : static Creates cookie from raw header string.
getDomain ( ) : string | null Gets the domain that the cookie is available to.
getExpiresTime ( ) : integer Gets the time the cookie expires.
getMaxAge ( ) : integer Gets the max-age attribute.
getName ( ) : string Gets the name of the cookie.
getPath ( ) : string Gets the path on the server in which the cookie will be available on.
getSameSite ( ) : string | null Gets the SameSite attribute.
getValue ( ) : string | null Gets the value of the cookie.
isCleared ( ) : boolean Whether this cookie is about to be cleared.
isHttpOnly ( ) : boolean Checks whether the cookie will be made accessible only through the HTTP protocol.
isRaw ( ) : boolean Checks if the cookie value should be sent with no url encoding.
isSecure ( ) : boolean Checks whether the cookie should only be transmitted over a secure HTTPS connection from the client.

Описание методов

__construct() публичный Метод

Constructor.
public __construct ( string $name, string | null $value = null, integer | string | DateTimeInterface $expire, string $path = '/', string | null $domain = null, boolean $secure = false, boolean $httpOnly = true, boolean $raw = false, string | null $sameSite = null )
$name string The name of the cookie
$value string | null The value of the cookie
$expire integer | string | DateTimeInterface The time the cookie expires
$path string The path on the server in which the cookie will be available on
$domain string | null The domain that the cookie is available to
$secure boolean Whether the cookie should only be transmitted over a secure HTTPS connection from the client
$httpOnly boolean Whether the cookie will be made accessible only through the HTTP protocol
$raw boolean Whether the cookie value should be sent with no url encoding
$sameSite string | null Whether the cookie will be available for cross-site requests

__toString() публичный Метод

Returns the cookie as a string.
public __toString ( ) : string
Результат string The cookie

fromString() публичный статический Метод

Creates cookie from raw header string.
public static fromString ( string $cookie, boolean $decode = false ) : static
$cookie string
$decode boolean
Результат static

getDomain() публичный Метод

Gets the domain that the cookie is available to.
public getDomain ( ) : string | null
Результат string | null

getExpiresTime() публичный Метод

Gets the time the cookie expires.
public getExpiresTime ( ) : integer
Результат integer

getMaxAge() публичный Метод

Gets the max-age attribute.
public getMaxAge ( ) : integer
Результат integer

getName() публичный Метод

Gets the name of the cookie.
public getName ( ) : string
Результат string

getPath() публичный Метод

Gets the path on the server in which the cookie will be available on.
public getPath ( ) : string
Результат string

getSameSite() публичный Метод

Gets the SameSite attribute.
public getSameSite ( ) : string | null
Результат string | null

getValue() публичный Метод

Gets the value of the cookie.
public getValue ( ) : string | null
Результат string | null

isCleared() публичный Метод

Whether this cookie is about to be cleared.
public isCleared ( ) : boolean
Результат boolean

isHttpOnly() публичный Метод

Checks whether the cookie will be made accessible only through the HTTP protocol.
public isHttpOnly ( ) : boolean
Результат boolean

isRaw() публичный Метод

Checks if the cookie value should be sent with no url encoding.
public isRaw ( ) : boolean
Результат boolean

isSecure() публичный Метод

Checks whether the cookie should only be transmitted over a secure HTTPS connection from the client.
public isSecure ( ) : boolean
Результат boolean

Описание свойств

$domain защищенное свойство

protected $domain

$expire защищенное свойство

protected $expire

$httpOnly защищенное свойство

protected $httpOnly

$name защищенное свойство

protected $name

$path защищенное свойство

protected $path

$secure защищенное свойство

protected $secure

$value защищенное свойство

protected $value