You are here

public function SessionCookieJar::save in Auth0 Single Sign On 8.2

Save cookies to the client session

1 call to SessionCookieJar::save()
SessionCookieJar::__destruct in vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php
Saves cookies to session when shutting down

File

vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php, line 42

Class

SessionCookieJar
Persists cookies in the client session

Namespace

GuzzleHttp\Cookie

Code

public function save() {
  $json = [];
  foreach ($this as $cookie) {

    /** @var SetCookie $cookie */
    if (CookieJar::shouldPersist($cookie, $this->storeSessionCookies)) {
      $json[] = $cookie
        ->toArray();
    }
  }
  $_SESSION[$this->sessionKey] = json_encode($json);
}