class CookieFactory

Properties

protected string $prefix The prefix for the cookie names.
protected string $path A path scope for the cookies.
protected string $domain A domain scope for the cookies.
protected bool $secure Whether the cookie(s) can be requested only over HTTPS.
protected string $samesite Same Site cookie value.

Methods

__construct(Config $config)

No description

SetCookie
make(string $name, string $value = null, int $maxAge = null)

Make a new cookie instance.

SetCookie
expire(string $name)

Make an expired cookie instance.

string
getName(string $name)

Get a cookie name.

Details

__construct(Config $config)

Parameters

Config $config

SetCookie make(string $name, string $value = null, int $maxAge = null)

Make a new cookie instance.

This method returns a cookie instance for use with the Set-Cookie HTTP header. It will be pre-configured according to Flarum's base URL and protocol.

Parameters

string $name
string $value
int $maxAge

Return Value

SetCookie

SetCookie expire(string $name)

Make an expired cookie instance.

Parameters

string $name

Return Value

SetCookie

string getName(string $name)

Get a cookie name.

Parameters

string $name

Return Value

string