PHP Класс yii\web\Cookie

For more details and usage information on Cookie, see the guide article on handling cookies.
С версии: 2.0
Автор: Qiang Xue ([email protected])
Наследование: extends yii\base\Object
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$domain domain of the cookie
$expire the timestamp at which the cookie expires. This is the server timestamp. Defaults to 0, meaning "until the browser is closed".
$httpOnly whether the cookie should be accessible only through the HTTP protocol. By setting this property to true, the cookie will not be accessible by scripting languages, such as JavaScript, which can effectively help to reduce identity theft through XSS attacks.
$name name of the cookie
$path the path on the server in which the cookie will be available on. The default is '/'.
$secure whether cookie should be sent via secure connection
$value value of the cookie

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

Метод Описание
__toString ( ) : string Magic method to turn a cookie object into a string without having to explicitly access [[value]].

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

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

php if (isset($request->cookies['name'])) { $value = (string) $request->cookies['name']; }
public __toString ( ) : string
Результат string The value of the cookie. If the value property is null, an empty string will be returned.

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

$domain публичное свойство

domain of the cookie
public $domain

$expire публичное свойство

the timestamp at which the cookie expires. This is the server timestamp. Defaults to 0, meaning "until the browser is closed".
public $expire

$httpOnly публичное свойство

whether the cookie should be accessible only through the HTTP protocol. By setting this property to true, the cookie will not be accessible by scripting languages, such as JavaScript, which can effectively help to reduce identity theft through XSS attacks.
public $httpOnly

$name публичное свойство

name of the cookie
public $name

$path публичное свойство

the path on the server in which the cookie will be available on. The default is '/'.
public $path

$secure публичное свойство

whether cookie should be sent via secure connection
public $secure

$value публичное свойство

value of the cookie
public $value