Requests_Cookie_Jar::before_redirect_check() WordPress Method

This method is used to check if a given URL is on the same domain as the current request. This is useful for checking if a redirect is valid before actually following it.

Requests_Cookie_Jar::before_redirect_check( $return ) #

Parse all cookies from a response and attach them to the response


Source

File: wp-includes/Requests/Cookie/Jar.php

	public function before_redirect_check(Requests_Response $return) {
		$url = $return->url;
		if (!$url instanceof Requests_IRI) {
			$url = new Requests_IRI($url);
		}

		$cookies         = Requests_Cookie::parse_from_headers($return->headers, $url);
		$this->cookies   = array_merge($this->cookies, $cookies);
		$return->cookies = $this;
	}

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.