Requests_Cookie::__construct() WordPress Method

The Requests_Cookie::__construct() method is used to create a new cookie object. This object can then be used to set and get cookie values.

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

Create a new cookie object


Parameters

$name

(string)(Required)

$value

(string)(Required)

$attributes

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

Default value: array()


Top ↑

Source

File: wp-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();
	}

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.