PHP 8.1.33
Preview: CHttpCookie.php Size: 2.67 KB
/home/jambtst2015/www/framework/web/CHttpCookie.php

<?php
/**
 * CHttpCookie class file.
 *
 * @author Qiang Xue <qiang.xue@gmail.com>
 * @link http://www.yiiframework.com/
 * @copyright 2008-2013 Yii Software LLC
 * @license http://www.yiiframework.com/license/
 */

/**
 * A CHttpCookie instance stores a single cookie, including the cookie name, value, domain, path, expire, and secure.
 *
 * @author Qiang Xue <qiang.xue@gmail.com>
 * @package system.web
 * @since 1.0
 */
class CHttpCookie extends CComponent
{
	/**
	 * @var string name of the cookie
	 */
	public $name;
	/**
	 * @var string value of the cookie
	 */
	public $value='';
	/**
	 * @var string domain of the cookie
	 */
	public $domain='';
	/**
	 * @var integer the timestamp at which the cookie expires. This is the server timestamp. Defaults to 0, meaning "until the browser is closed".
	 */
	public $expire=0;
	/**
	 * @var string the path on the server in which the cookie will be available on. The default is '/'.
	 */
	public $path='/';
	/**
	 * @var boolean whether cookie should be sent via secure connection
	 */
	public $secure=false;
	/**
	 * @var boolean 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.
	 */
	public $httpOnly=false;

	/**
	 * Constructor.
	 * @param string $name name of this cookie
	 * @param string $value value of this cookie
	 * @param array $options the configuration array consisting of name-value pairs
	 * that are used to configure this cookie
	 */
	public function __construct($name,$value,$options=array())
	{
		$this->name=$name;
		$this->value=$value;
		$this->configure($options);
	}
	/**
	 * This method can be used to configure the CookieObject with an array
	 * Note: you cannot use this method to set the name and/or the value of the cookie
	 * @param array $options the configuration array consisting of name-value pairs
	 * that are used to configure this cookie
	 * @since 1.1.11
	 */
	public function configure($options=array())
	{
		foreach($options as $name=>$value)
		{
			if($name==='name'||$name==='value')
				continue;
			$this->$name=$value;
		}
	}
	/**
	 * Magic method to use the cookie object as a string without having to call value property first.
	 * <code>
	 * $value = (string)$cookies['name'];
	 * </code>
	 * Note, that you still have to check if the cookie exists.
	 * @return string The value of the cookie. If the value property is null an empty string will be returned.
	 * @since 1.1.11
	 */
	public function __toString()
	{
		return (string)$this->value;
	}
}

Directory Contents

Dirs: 9 × Files: 28

Name Size Perms Modified Actions
actions DIR
- drwxr-xr-x 2025-10-08 19:22:44
Edit Download
auth DIR
- drwxr-xr-x 2025-10-08 19:45:04
Edit Download
filters DIR
- drwxr-xr-x 2025-10-11 10:02:11
Edit Download
form DIR
- drwxr-xr-x 2025-10-09 05:45:59
Edit Download
helpers DIR
- drwxr-xr-x 2025-10-11 04:35:21
Edit Download
js DIR
- drwxr-xr-x 2025-10-15 09:54:12
Edit Download
renderers DIR
- drwxr-xr-x 2025-10-11 01:32:19
Edit Download
services DIR
- drwxr-xr-x 2025-10-12 12:01:04
Edit Download
widgets DIR
- drwxr-xr-x 2025-10-08 17:42:55
Edit Download
6.45 KB lrw-r--r-- 2024-11-22 17:53:15
Edit Download
5.93 KB lrw-r--r-- 2024-11-22 17:53:15
Edit Download
13.46 KB lrw-r--r-- 2024-11-22 17:53:15
Edit Download
9.99 KB lrw-r--r-- 2024-11-22 17:53:15
Edit Download
3.20 KB lrw-r--r-- 2024-11-22 17:53:15
Edit Download
27.88 KB lrw-r--r-- 2024-11-22 17:53:15
Edit Download
46.39 KB lrw-r--r-- 2024-11-22 17:53:15
Edit Download
7.01 KB lrw-r--r-- 2024-11-22 17:53:15
Edit Download
4.21 KB lrw-r--r-- 2024-11-22 17:53:15
Edit Download
8.63 KB lrw-r--r-- 2024-11-22 17:53:15
Edit Download
1.45 KB lrw-r--r-- 2024-11-22 17:53:15
Edit Download
2.12 KB lrw-r--r-- 2024-11-22 17:53:15
Edit Download
2.67 KB lrw-r--r-- 2024-11-22 17:53:15
Edit Download
47.44 KB lrw-r--r-- 2024-11-22 17:53:15
Edit Download
16.31 KB lrw-r--r-- 2024-11-22 17:53:15
Edit Download
1.87 KB lrw-r--r-- 2024-11-22 17:53:15
Edit Download
883 B lrw-r--r-- 2024-11-22 17:53:15
Edit Download
7.14 KB lrw-r--r-- 2024-11-22 17:53:15
Edit Download
17.31 KB lrw-r--r-- 2024-11-22 17:53:15
Edit Download
4.18 KB lrw-r--r-- 2024-11-22 17:53:15
Edit Download
3.58 KB lrw-r--r-- 2024-11-22 17:53:15
Edit Download
3.68 KB lrw-r--r-- 2024-11-22 17:53:15
Edit Download
9.13 KB lrw-r--r-- 2024-11-22 17:53:15
Edit Download
27.42 KB lrw-r--r-- 2024-11-22 17:53:15
Edit Download
16.96 KB lrw-r--r-- 2024-11-22 17:53:15
Edit Download
6.53 KB lrw-r--r-- 2024-11-22 17:53:15
Edit Download
7.38 KB lrw-r--r-- 2024-11-22 17:53:15
Edit Download
192.84 KB lrw-r--r-- 2025-11-04 15:12:28
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).