Cookie
class Cookie (View source)
A set of static methods for manipulating cookies.
Traits
Provides extensions to this object to integrate it with standard config API methods.
Constants
SAMESITE_LAX |
|
SAMESITE_STRICT |
|
SAMESITE_NONE |
|
Config options
report_errors | bool | ||
default_samesite | string | Must be "Strict", "Lax", or "None" |
Properties
Methods
Get a configuration accessor for this class. Short hand for Config::inst()->get($this->class, .....).
Gets the uninherited value for the given config option
Set a cookie variable.
Get the cookie value by name. Returns null if not set.
No description
Validate if the samesite value for a cookie is valid for the current request.
Details
static Config_ForClass
config()
Get a configuration accessor for this class. Short hand for Config::inst()->get($this->class, .....).
mixed
uninherited(string $name)
Gets the uninherited value for the given config option
static Cookie_Backend
get_inst()
Fetch the current instance of the cookie backend.
static
set(string $name, mixed $value, float $expiry = 90, string $path = null, string $domain = null, bool $secure = false, bool $httpOnly = true)
Set a cookie variable.
Expiry time is set in days, and defaults to 90.
static null|string
get(string $name, bool $includeUnsent = true)
Get the cookie value by name. Returns null if not set.
static array
get_all(bool $includeUnsent = true)
Get all the cookies.
static
force_expiry(string $name, null|string $path = null, null|string $domain = null, bool $secure = false, bool $httpOnly = true)
No description
static void
validateSameSite(string $sameSite)
Validate if the samesite value for a cookie is valid for the current request.
Logs a warning if the samesite value is "None" for a non-https request.