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
 1: <?php
 2: /**
 3:  * CHttpCookie class file.
 4:  *
 5:  * @author Qiang Xue <qiang.xue@gmail.com>
 6:  * @link http://www.yiiframework.com/
 7:  * @copyright 2008-2013 Yii Software LLC
 8:  * @license http://www.yiiframework.com/license/
 9:  */
10: 
11: /**
12:  * A CHttpCookie instance stores a single cookie, including the cookie name, value, domain, path, expire, and secure.
13:  *
14:  * @author Qiang Xue <qiang.xue@gmail.com>
15:  * @package system.web
16:  * @since 1.0
17:  */
18: class CHttpCookie extends CComponent
19: {
20:     /**
21:      * @var string name of the cookie
22:      */
23:     public $name;
24:     /**
25:      * @var string value of the cookie
26:      */
27:     public $value='';
28:     /**
29:      * @var string domain of the cookie
30:      */
31:     public $domain='';
32:     /**
33:      * @var integer the timestamp at which the cookie expires. This is the server timestamp. Defaults to 0, meaning "until the browser is closed".
34:      */
35:     public $expire=0;
36:     /**
37:      * @var string the path on the server in which the cookie will be available on. The default is '/'.
38:      */
39:     public $path='/';
40:     /**
41:      * @var boolean whether cookie should be sent via secure connection
42:      */
43:     public $secure=false;
44:     /**
45:      * @var boolean whether the cookie should be accessible only through the HTTP protocol.
46:      * By setting this property to true, the cookie will not be accessible by scripting languages,
47:      * such as JavaScript, which can effectly help to reduce identity theft through XSS attacks.
48:      * Note, this property is only effective for PHP 5.2.0 or above.
49:      */
50:     public $httpOnly=false;
51: 
52:     /**
53:      * Constructor.
54:      * @param string $name name of this cookie
55:      * @param string $value value of this cookie
56:      * @param array $options the configuration array consisting of name-value pairs
57:      * that are used to configure this cookie
58:      */
59:     public function __construct($name,$value,$options=array())
60:     {
61:         $this->name=$name;
62:         $this->value=$value;
63:         $this->configure($options);
64:     }
65:     /**
66:      * This method can be used to configure the CookieObject with an array
67:      * Note: you cannot use this method to set the name and/or the value of the cookie
68:      * @param array $options the configuration array consisting of name-value pairs
69:      * that are used to configure this cookie
70:      * @since 1.1.11
71:      */
72:     public function configure($options=array())
73:     {
74:         foreach($options as $name=>$value)
75:         {
76:             if($name==='name'||$name==='value')
77:                 continue;
78:             $this->$name=$value;
79:         }
80:     }
81:     /**
82:      * Magic method to use the cookie object as a string without having to call value property first.
83:      * <code>
84:      * $value = (string)$cookies['name'];
85:      * </code>
86:      * Note, that you still have to check if the cookie exists.
87:      * @return string The value of the cookie. If the value property is null an empty string will be returned.
88:      * @since 1.1.11
89:      */
90:     public function __toString()
91:     {
92:         return (string)$this->value;
93:     }
94: }
95: 
API documentation generated by ApiGen 2.8.0