class CookieFactory

Properties

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

Methods

__construct(Config $config)

No description

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