function SessionCookieJar::load
Load the contents of the client session into the data array
1 call to SessionCookieJar::load()
- SessionCookieJar::__construct in vendor/
guzzlehttp/ guzzle/ src/ Cookie/ SessionCookieJar.php - Create a new SessionCookieJar object
File
-
vendor/
guzzlehttp/ guzzle/ src/ Cookie/ SessionCookieJar.php, line 63
Class
- SessionCookieJar
- Persists cookies in the client session
Namespace
GuzzleHttp\CookieCode
protected function load() : void {
if (!isset($_SESSION[$this->sessionKey])) {
return;
}
$data = \json_decode($_SESSION[$this->sessionKey], true);
if (\is_array($data)) {
foreach ($data as $cookie) {
$this->setCookie(new SetCookie($cookie));
}
}
elseif (\strlen($data)) {
throw new \RuntimeException('Invalid cookie data');
}
}