\GuzzleHttp\CookieFileCookieJar

Persists non-session cookies using a JSON formatted file

Summary

Methods
Properties
Constants
__construct()
__destruct()
save()
load()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$filename
$storeSessionCookies
N/A

Properties

$filename

$filename : string

Type

string — filename

$storeSessionCookies

$storeSessionCookies : boolean

Type

boolean — Control whether to persist session cookies or not.

Methods

__construct()

__construct(string  $cookieFile, boolean  $storeSessionCookies = false) 

Create a new FileCookieJar object

Parameters

string $cookieFile

File to store the cookie data

boolean $storeSessionCookies

Set to true to store session cookies in the cookie jar.

Throws

\RuntimeException

if the file cannot be found or created

__destruct()

__destruct() 

Saves the file when shutting down

save()

save(string  $filename) 

Saves the cookies to a file.

Parameters

string $filename

File to save

Throws

\RuntimeException

if the file cannot be found or created

load()

load(string  $filename) 

Load cookies from a JSON formatted file.

Old cookies are kept unless overwritten by newly loaded ones.

Parameters

string $filename

Cookie file to load.

Throws

\RuntimeException

if the file cannot be loaded.