Title: Cookie::__toString
Published: March 29, 2023
Last modified: November 8, 2023

---

# Cookie::__toString()

## In this article

 * [Description](https://developer.wordpress.org/reference/classes/wporg-requests-cookie/__tostring/?output_format=md#description)
 * [Source](https://developer.wordpress.org/reference/classes/wporg-requests-cookie/__tostring/?output_format=md#source)

[ Back to top](https://developer.wordpress.org/reference/classes/wporg-requests-cookie/__tostring/?output_format=md#wp--skip-link--target)

Get the cookie value

## 󠀁[Description](https://developer.wordpress.org/reference/classes/wporg-requests-cookie/__tostring/?output_format=md#description)󠁿

Attributes and other data can be accessed via methods.

## 󠀁[Source](https://developer.wordpress.org/reference/classes/wporg-requests-cookie/__tostring/?output_format=md#source)󠁿

    ```php
    public function __toString() {
    	return $this->value;
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/requests/src/cookie.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.1/src/wp-includes/Requests/src/Cookie.php#L127)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/Requests/src/Cookie.php#L127-L129)

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwporg-requests-cookie%2F__tostring%2F)
before being able to contribute a note or feedback.