Class CCookieCollection
CCookieCollection implements a collection class to store cookies.
You normally access it via CHttpRequest::getCookies()
.
Since CCookieCollection extends from CMap
, it can be used like an
associative array as follows:
$cookies[$name]=new CHttpCookie($name,$value); // sends a cookie $value=$cookies[$name]->value; // reads a cookie value unset($cookies[$name]); // removes a cookie
- CComponent
- CMap implements IteratorAggregate, ArrayAccess, Countable
- CCookieCollection
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/CHttpRequest.php
public
|
|
public
|
|
protected
array
|
|
public
|
#
add( mixed $name,
Adds a cookie with the specified name. This overrides the parent implementation by performing additional operations for each newly added CHttpCookie object. |
public
|
#
remove( mixed $name, array $options = array() )
Removes a cookie with the specified name. This overrides the parent implementation by performing additional cleanup work when removing a CHttpCookie object. Since version 1.1.11, the second parameter is available that can be used to specify the options of the CHttpCookie being removed. For example, this may be useful when dealing with ".domain.tld" where multiple subdomains are expected to be able to manage cookies: |
protected
|
|
protected
|
clear(),
contains(),
copyFrom(),
count(),
getCount(),
getIterator(),
getKeys(),
getReadOnly(),
itemAt(),
mergeArray(),
mergeWith(),
offsetExists(),
offsetGet(),
offsetSet(),
offsetUnset(),
setReadOnly(),
toArray()
|
$count,
$iterator,
$keys,
$readOnly
|