Overview

Packages

  • application
    • commands
    • components
      • actions
      • filters
      • leftWidget
      • permissions
      • sortableWidget
      • util
      • webupdater
      • x2flow
        • actions
        • triggers
      • X2GridView
      • X2Settings
    • controllers
    • models
      • embedded
    • modules
      • accounts
        • controllers
        • models
      • actions
        • controllers
        • models
      • calendar
        • controllers
        • models
      • charts
        • models
      • contacts
        • controllers
        • models
      • docs
        • components
        • controllers
        • models
      • groups
        • controllers
        • models
      • marketing
        • components
        • controllers
        • models
      • media
        • controllers
        • models
      • mobile
        • components
      • opportunities
        • controllers
        • models
      • products
        • controllers
        • models
      • quotes
        • controllers
        • models
      • services
        • controllers
        • models
      • template
        • models
      • users
        • controllers
        • models
      • workflow
        • controllers
        • models
      • x2Leads
        • controllers
        • models
  • Net
  • None
  • PHP
  • system
    • base
    • caching
      • dependencies
    • collections
    • console
    • db
      • ar
      • schema
        • cubrid
        • mssql
        • mysql
        • oci
        • pgsql
        • sqlite
    • i18n
      • gettext
    • logging
    • test
    • utils
    • validators
    • web
      • actions
      • auth
      • filters
      • form
      • helpers
      • renderers
      • services
      • widgets
        • captcha
        • pagers
  • Text
    • Highlighter
  • zii
    • behaviors
    • widgets
      • grid
      • jui

Classes

  • ActionFormModelBase
  • CActiveDataProvider
  • CalendarEventFormModel
  • CallFormModel
  • CArrayDataProvider
  • CAssetManager
  • CBaseController
  • CBaseUrlRule
  • CCacheHttpSession
  • CClientScript
  • CController
  • CCookieCollection
  • CDataProvider
  • CDataProviderIterator
  • CDbHttpSession
  • CExtController
  • CFormModel
  • CHttpCookie
  • CHttpRequest
  • CHttpSession
  • CHttpSessionIterator
  • COutputEvent
  • CPagination
  • CreatePageFormModel
  • CSort
  • CSqlDataProvider
  • CTheme
  • CThemeManager
  • CUploadedFile
  • CUrlManager
  • CUrlRule
  • CWebApplication
  • CWebModule
  • CWidgetFactory
  • EditMobileFormsFormModel
  • EventCommentPublisherFormModel
  • EventFormModel
  • EventPublisherFormModel
  • FileSystemObjectDataProvider
  • MassActionFormModel
  • MobilePagination
  • NoteFormModel
  • NotificationsController
  • TimeFormModel
  • UploadLogoFormModel
  • X2FormModel
  • X2HttpRequest

Interfaces

  • IDataProvider
  • IWidgetFactory
  • Overview
  • Package
  • Class
  • Tree

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
Extended by CMap implements IteratorAggregate, ArrayAccess, Countable
Extended by CCookieCollection
Package: system\web
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
Methods summary
public
# __construct( CHttpRequest $request )

Constructor.

Constructor.

Parameters

$request
CHttpRequest
$request owner of this collection.

Throws

CException
If data is not null and neither an array nor an iterator.

Overrides

CMap::__construct()
public CHttpRequest
# getRequest( )

Returns

CHttpRequest
the request instance
protected array
# getCookies( )

Returns

array
list of validated cookies
public
# add( mixed $name, CHttpCookie $cookie )

Adds a cookie with the specified name. This overrides the parent implementation by performing additional operations for each newly added CHttpCookie object.

Adds a cookie with the specified name. This overrides the parent implementation by performing additional operations for each newly added CHttpCookie object.

Parameters

$name
mixed
$name Cookie name.
$cookie
CHttpCookie
$cookie Cookie object.

Throws

CException
if the item to be inserted is not a CHttpCookie object.

Overrides

CMap::add()
public CHttpCookie
# 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:

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:

$options=array('domain'=>'.domain.tld');
Yii::app()->request->cookies['foo']=new CHttpCookie('cookie','value',$options);
Yii::app()->request->cookies->remove('cookie',$options);

Parameters

$name
mixed
$name Cookie name.
$options
array
$options Cookie configuration array consisting of name-value pairs, available since 1.1.11.

Returns

CHttpCookie
The removed cookie object.

Throws

CException
if the map is read-only

Overrides

CMap::remove()
protected
# addCookie( CHttpCookie $cookie )

Sends a cookie.

Sends a cookie.

Parameters

$cookie
CHttpCookie
$cookie cookie to be sent
protected
# removeCookie( CHttpCookie $cookie )

Deletes a cookie.

Deletes a cookie.

Parameters

$cookie
CHttpCookie
$cookie cookie to be deleted
Methods inherited from CMap
clear(), contains(), copyFrom(), count(), getCount(), getIterator(), getKeys(), getReadOnly(), itemAt(), mergeArray(), mergeWith(), offsetExists(), offsetGet(), offsetSet(), offsetUnset(), setReadOnly(), toArray()
Methods inherited from CComponent
__call(), __get(), __isset(), __set(), __unset(), asa(), attachBehavior(), attachBehaviors(), attachEventHandler(), canGetProperty(), canSetProperty(), detachBehavior(), detachBehaviors(), detachEventHandler(), disableBehavior(), disableBehaviors(), enableBehavior(), enableBehaviors(), evaluateExpression(), getEventHandlers(), hasEvent(), hasEventHandler(), hasProperty(), raiseEvent()
Magic properties inherited from CMap
$count, $iterator, $keys, $readOnly
API documentation generated by ApiGen 2.8.0