class CookieFactory

Properties

protected string $prefix
protected string $path
protected string $domain
protected bool $secure
protected string|null $samesite

Methods

__construct(Config $config)

No description

SetCookie
make(string $name, string|null $value = null, int|null $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|null $value = null, int|null $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|null $value
int|null $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