You are here

private function SearchApiAcquiaSearchConnectionV3::createAuthCookie in Acquia Search for Search API 7.2

Creates auth cookie.

Parameters

string $url: Request URL.

string $nonce: Nonce.

string $string: Payload.

Return value

string Cookie.

1 call to SearchApiAcquiaSearchConnectionV3::createAuthCookie()
SearchApiAcquiaSearchConnectionV3::prepareRequest in includes/v3/SearchApiAcquiaSearchConnectionV3.php
Prepares request before send.

File

includes/v3/SearchApiAcquiaSearchConnectionV3.php, line 168

Class

SearchApiAcquiaSearchConnectionV3
Starting point for the Solr API. Represents a Solr server resource and has methods for pinging, adding, deleting, committing, optimizing and searching.

Code

private function createAuthCookie($url, $nonce, $string = '') {
  if (!empty($string)) {
    $auth_string = $this
      ->buildAuthString($string, $nonce);
    return $auth_string;
  }
  $uri = parse_url($url);
  $path = isset($uri['path']) ? $uri['path'] : '/';
  $query = isset($uri['query']) ? '?' . $uri['query'] : '';
  $auth_string = $this
    ->buildAuthString($path . $query, $nonce);
  return $auth_string;
}