Copied!

Persists non-session cookies using a JSON formatted file

Cloneable Instantiable Iterable
Methods
public __construct ( string $cookieFile , bool $storeSessionCookies = false )
 

Create a new FileCookieJar object

  • param bool $strictMode Set to true to throw exceptions when invalid
    cookies are added to the cookie jar.
  • param array $cookieArray Array of SetCookie objects or a hash of
    arrays that can be used with the SetCookie
    constructor
  • param bool $storeSessionCookies Set to true to store session cookies
    in the cookie jar.
  • throws RuntimeException if the file cannot be found or created
public __destruct ()
 

Saves the file when shutting down

public load ( string $filename ) : void
 

Load cookies from a JSON formatted file.

Old cookies are kept unless overwritten by newly loaded ones.

  • param string $filename Cookie file to load.
  • throws RuntimeException if the file cannot be loaded.
public save ( string $filename ) : void
 

Saves the cookies to a file.

  • param string $filename File to save
  • throws RuntimeException if the file cannot be found or created
Properties
private $filename
 
  • var string filename
private $storeSessionCookies
 
  • var bool Control whether to persist session cookies or not.
Methods
© 2022 Bruce Wells
Search Namespaces \ Classes
Configuration