Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. SessionCookieJar.php

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\Cookie

Code

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');
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal