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
파일 보기 프로젝트 열기: yiisoft/yii2 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$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