public function setRedirectUrl($redirect = null, $key = null) {
		if (empty($redirect)) {
			$redirect = $this->_controller->request->referer(true);
		} elseif ($redirect === true) {
			$redirect = $this->_controller->request->here(true);
		}
		if (empty($redirect) || $this->_controller->request->is('popup') ||
			$this->_controller->request->is('print')) {
			return false;
		}
		$cacheKey = $this->_getSessionKeyRedirect($key);
		$data = CakeSession::read($cacheKey);
		if (!empty($data) && (md5((string)$data) === md5((string)$redirect))) {
			return false;
		}

		return CakeSession::write($cacheKey, $redirect);
	}
public function setRedirectUrl($redirect = null, $key = null) {
		if (empty($redirect)) {
			$redirect = $this->_controller->request->referer(true);
		} elseif ($redirect === true) {
			$redirect = $this->_controller->request->here(true);
		}
		if (empty($redirect) || $this->_controller->request->is('popup') ||
			$this->_controller->request->is('print')) {
			return false;
		}
		$cacheKey = $this->_getSessionKeyRedirect($key);
		$data = CakeSession::read($cacheKey);
		if (!empty($data) && (md5((string)$data) === md5((string)$redirect))) {
			return false;
		}

		return CakeSession::write($cacheKey, $redirect);
	}
public function setRedirectUrl ( $ redirect = null , $ key = null ) { if ( empty ( $ redirect ) ) { $ redirect = $ this -> _controller -> request -> referer ( true ) ; } elseif ( $ redirect === true ) { $ redirect = $ this -> _controller -> request -> here ( true ) ; } if ( empty ( $ redirect ) || $ this -> _controller -> request -> is ( 'popup' ) || $ this -> _controller -> request -> is ( 'print' ) ) { return false ; } $ cacheKey = $ this -> _getSessionKeyRedirect ( $ key ) ; $ data = CakeSession :: read ( $ cacheKey ) ; if ( ! empty ( $ data ) && ( md5 ( ( string ) $ data ) === md5 ( ( string ) $ redirect ) ) ) { return false ; } return CakeSession :: write ( $ cacheKey , $ redirect ) ; }
Set redirect URL to cache

@param string|array|bool $redirect Redirect URL. If empty,
use redirect URL. If True, use current URL.
@param string $key Key for cache
@return bool Success
Set redirect URL to cache