You are here

protected function SessionCookieJar::load in Lockr 7.3

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 57

Class

SessionCookieJar
Persists cookies in the client session

Namespace

GuzzleHttp\Cookie

Code

protected function load() {
  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");
  }
}