You are here

public static function CookieJar::getCookieValue in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php \GuzzleHttp\Cookie\CookieJar::getCookieValue()

Quote the cookie value if it is not already quoted and it contains problematic characters.

Parameters

string $value Value that may or may not need to be quoted:

Return value

string

1 call to CookieJar::getCookieValue()
CookieJar::withCookieHeader in vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php
Create a request with added cookie headers.

File

vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php, line 68

Class

CookieJar
Cookie jar that stores cookies an an array

Namespace

GuzzleHttp\Cookie

Code

public static function getCookieValue($value) {
  if (substr($value, 0, 1) !== '"' && substr($value, -1, 1) !== '"' && strpbrk($value, ';,=')) {
    $value = '"' . $value . '"';
  }
  return $value;
}