WP_Http_Cookie::get_attributes() WordPress Method

The WP_Http_Cookie::get_attributes() method is used to get the attributes of a given cookie. The attributes include the name, value, domain, path, expiry, and secure flag. This method can be useful for debugging purposes or for extracting information from a cookie.

WP_Http_Cookie::get_attributes() #

Retrieves cookie attributes.


Return

(array) List of attributes.

  • 'expires'
    (string|int|null) When the cookie expires. Unix timestamp or formatted date.
  • 'path'
    (string) Cookie URL path.
  • 'domain'
    (string) Cookie domain.


Top ↑

Source

File: wp-includes/class-wp-http-cookie.php

	public function get_attributes() {
		return array(
			'expires' => $this->expires,
			'path'    => $this->path,
			'domain'  => $this->domain,
		);
	}

Top ↑

Changelog

Changelog
VersionDescription
4.6.0Introduced.

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.