~horux-dev/horux-webcli/thfo

« back to all changes in this revision

Viewing changes to yii/framework/web/CHttpCookie.php

  • Committer: Thierry Forchelet
  • Date: 2011-02-25 13:30:15 UTC
  • Revision ID: thierry.forchelet@letux.ch-20110225133015-zxyj9w7sqv8ly971
Initial commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
/**
 
3
 * CHttpCookie class file.
 
4
 *
 
5
 * @author Qiang Xue <qiang.xue@gmail.com>
 
6
 * @link http://www.yiiframework.com/
 
7
 * @copyright Copyright &copy; 2008-2011 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
 * @version $Id: CHttpCookie.php 2799 2011-01-01 19:31:13Z qiang.xue $
 
16
 * @package system.web
 
17
 * @since 1.0
 
18
 */
 
19
class CHttpCookie extends CComponent
 
20
{
 
21
        /**
 
22
         * @var string name of the cookie
 
23
         */
 
24
        public $name;
 
25
        /**
 
26
         * @var string value of the cookie
 
27
         */
 
28
        public $value='';
 
29
        /**
 
30
         * @var string domain of the cookie
 
31
         */
 
32
        public $domain='';
 
33
        /**
 
34
         * @var integer the timestamp at which the cookie expires. This is the server timestamp. Defaults to 0, meaning "until the browser is closed".
 
35
         */
 
36
        public $expire=0;
 
37
        /**
 
38
         * @var string the path on the server in which the cookie will be available on. The default is '/'.
 
39
         */
 
40
        public $path='/';
 
41
        /**
 
42
         * @var boolean whether cookie should be sent via secure connection
 
43
         */
 
44
        public $secure=false;
 
45
        /**
 
46
         * @var boolean whether the cookie should be accessible only through the HTTP protocol.
 
47
         * By setting this property to true, the cookie will not be accessible by scripting languages,
 
48
         * such as JavaScript, which can effectly help to reduce identity theft through XSS attacks.
 
49
         * Note, this property is only effective for PHP 5.2.0 or above.
 
50
         */
 
51
        public $httpOnly=false;
 
52
 
 
53
        /**
 
54
         * Constructor.
 
55
         * @param string $name name of this cookie
 
56
         * @param string $value value of this cookie
 
57
         */
 
58
        public function __construct($name,$value)
 
59
        {
 
60
                $this->name=$name;
 
61
                $this->value=$value;
 
62
        }
 
63
}