Class CHttpCookie
A CHttpCookie instance stores a single cookie, including the cookie name, value, domain, path, expire, and secure.
- CComponent
- CHttpCookie
Copyright: 2008-2013 Yii Software LLC
License: http://www.yiiframework.com/license/
Author: Qiang Xue <qiang.xue@gmail.com>
Since: 1.0
Located at x2engine/framework/web/CHttpCookie.php
public
|
|
public
|
|
public
string
|
#
__toString( )
Magic method to use the cookie object as a string without having to call value property first. $value = (string)$cookies['name']; Note, that you still have to check if the cookie exists. |
public
string
|
$name |
|
#
name of the cookie |
public
string
|
$value | '' |
#
value of the cookie |
public
string
|
$domain | '' |
#
domain of the cookie |
public
integer
|
$expire | 0 |
#
the timestamp at which the cookie expires. This is the server timestamp. Defaults to 0, meaning "until the browser is closed". |
public
string
|
$path | '/' |
#
the path on the server in which the cookie will be available on. The default is '/'. |
public
boolean
|
$secure | false |
#
whether cookie should be sent via secure connection |
public
boolean
|
$httpOnly | false |
#
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 effectly help to reduce identity theft through XSS attacks. Note, this property is only effective for PHP 5.2.0 or above. |