Requests_Cookie::__construct()

最后更新于:2021-11-26 01:36:41

Requests_Cookie::__construct( string$name, string$value, array|Requests_Utility_CaseInsensitiveDictionary$attributes=array(), $flags=array(), $reference_time=null)

Create a new cookie object

参数

$name

(string) (Required)

$value

(string) (Required)

$attributes

(array|Requests_Utility_CaseInsensitiveDictionary) (Optional) Associative array of attribute data

Default value: array()

源文件

文件: gc-includes/Requests/Cookie.php

	public function __construct($name, $value, $attributes = array(), $flags = array(), $reference_time = null) {
		$this->name       = $name;
		$this->value      = $value;
		$this->attributes = $attributes;
		$default_flags    = array(
			'creation'    => time(),
			'last-access' => time(),
			'persistent'  => false,
			'host-only'   => true,
		);
		$this->flags      = array_merge($default_flags, $flags);

		$this->reference_time = time();
		if ($reference_time !== null) {
			$this->reference_time = $reference_time;
		}

		$this->normalize();
	}