class CookieFactory

Properties

protected $prefix
protected $path
protected $domain
protected $secure
protected $samesite

Methods

__construct(Config $config)

No description

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

<p>Make a new cookie instance.</p>

SetCookie
expire(string $name)

<p>Make an expired cookie instance.</p>

string
getName(string $name)

<p>Get a cookie name.</p>

Details

__construct(Config $config)

Parameters

Config $config

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

<p>Make a new cookie instance.</p>

<p>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.</p>

Parameters

string $name
string|null $value
int|null $maxAge

Return Value

SetCookie

SetCookie expire(string $name)

<p>Make an expired cookie instance.</p>

Parameters

string $name

Return Value

SetCookie

string getName(string $name)

<p>Get a cookie name.</p>

Parameters

string $name

Return Value

string