You are here

public function SessionCookieJar::save in Lockr 7.3

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 41

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