Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.3.x will end 7 October 2024 (12 months).
  • Bug fixes for security issues in 4.3.x will end 21 April 2025 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.2.x is supported too.

(no description)

File Size: 101 lines (3 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

FileCookieJar:: (4 methods):
  __construct()
  __destruct()
  save()
  load()


Class: FileCookieJar  - X-Ref

Persists non-session cookies using a JSON formatted file

__construct(string $cookieFile, bool $storeSessionCookies = false)   X-Ref
Create a new FileCookieJar object

param: string $cookieFile          File to store the cookie data
param: bool   $storeSessionCookies Set to true to store session cookies

__destruct()   X-Ref
Saves the file when shutting down


save(string $filename)   X-Ref
Saves the cookies to a file.

param: string $filename File to save

load(string $filename)   X-Ref
Load cookies from a JSON formatted file.

Old cookies are kept unless overwritten by newly loaded ones.

param: string $filename Cookie file to load.