Class FileCookieJar
Persists non-session cookies using a JSON formatted file
-
GuzzleHttp\Cookie\CookieJar
implements
GuzzleHttp\Cookie\CookieJarInterface
-
GuzzleHttp\Cookie\FileCookieJar
Methods summary
public
|
#
__construct( string $cookieFile, boolean $storeSessionCookies = false )
Create a new FileCookieJar object
Create a new FileCookieJar object
Parameters
- $cookieFile
- File to store the cookie data
- $storeSessionCookies
Set to true to store session cookies
in the cookie jar.
Throws
RuntimeException if the file cannot be found or created
Overrides
|
public
|
#
__destruct( )
Saves the file when shutting down
Saves the file when shutting down
|
public
|
#
save( string $filename )
Saves the cookies to a file.
Saves the cookies to a file.
Parameters
Throws
RuntimeException if the file cannot be found or created
|
public
|
#
load( string $filename )
Load cookies from a JSON formatted file.
Load cookies from a JSON formatted file.
Old cookies are kept unless overwritten by newly loaded ones.
Parameters
- $filename
- Cookie file to load.
Throws
RuntimeException if the file cannot be loaded.
|
Methods inherited from GuzzleHttp\Cookie\CookieJar
clear(),
clearSessionCookies(),
count(),
extractCookies(),
fromArray(),
getCookieByName(),
getCookieValue(),
getIterator(),
setCookie(),
shouldPersist(),
toArray(),
withCookieHeader()
|