HumHub Documentation (unofficial)

Cookie
in package
implements ArrayAccess

Set values of an cookie.

Implements ArrayAccess for backwards compatibility.

Tags
see
https://w3c.github.io/webdriver/#cookies

Table of Contents

Interfaces

ArrayAccess

Properties

$cookie  : array<string|int, mixed>

Methods

__construct()  : mixed
createFromArray()  : Cookie
getDomain()  : string|null
getExpiry()  : int|null
getName()  : string
getPath()  : string|null
getSameSite()  : string|null
getValue()  : string
isHttpOnly()  : bool|null
isSecure()  : bool|null
offsetExists()  : bool
offsetGet()  : mixed
offsetSet()  : void
offsetUnset()  : void
setDomain()  : mixed
The domain the cookie is visible to. Defaults to the current browsing context's document's URL domain if omitted.
setExpiry()  : mixed
The cookie's expiration date, specified in seconds since Unix Epoch.
setHttpOnly()  : mixed
Whether the cookie is an HTTP only cookie. Defaults to false if omitted.
setPath()  : mixed
The path the cookie is visible to. Defaults to "/" if omitted.
setSameSite()  : mixed
The cookie's same-site value.
setSecure()  : mixed
Whether this cookie requires a secure connection (https). Defaults to false if omitted.
toArray()  : array<string|int, mixed>
validateCookieName()  : mixed
validateCookieValue()  : mixed

Properties

protected array<string|int, mixed> $cookie = []

Methods

__construct()

public __construct(string $name, string $value) : mixed
Parameters
$name : string

The name of the cookie; may not be null or an empty string.

$value : string

The cookie value; may not be null.

createFromArray()

public static createFromArray(array<string|int, mixed> $cookieArray) : Cookie
Parameters
$cookieArray : array<string|int, mixed>

The cookie fields; must contain name and value.

Return values
Cookie

getDomain()

public getDomain() : string|null
Return values
string|null

getExpiry()

public getExpiry() : int|null
Return values
int|null

getName()

public getName() : string
Return values
string

getPath()

public getPath() : string|null
Return values
string|null

getSameSite()

public getSameSite() : string|null
Return values
string|null

getValue()

public getValue() : string
Return values
string

isHttpOnly()

public isHttpOnly() : bool|null
Return values
bool|null

isSecure()

public isSecure() : bool|null
Return values
bool|null

offsetExists()

public offsetExists(mixed $offset) : bool
Parameters
$offset : mixed
Attributes
#[ReturnTypeWillChange]
Return values
bool

offsetSet()

public offsetSet(mixed $offset, mixed $value) : void
Parameters
$offset : mixed
$value : mixed
Attributes
#[ReturnTypeWillChange]

setDomain()

The domain the cookie is visible to. Defaults to the current browsing context's document's URL domain if omitted.

public setDomain(string $domain) : mixed
Parameters
$domain : string

setExpiry()

The cookie's expiration date, specified in seconds since Unix Epoch.

public setExpiry(int $expiry) : mixed
Parameters
$expiry : int

setHttpOnly()

Whether the cookie is an HTTP only cookie. Defaults to false if omitted.

public setHttpOnly(bool $httpOnly) : mixed
Parameters
$httpOnly : bool

setPath()

The path the cookie is visible to. Defaults to "/" if omitted.

public setPath(string $path) : mixed
Parameters
$path : string

setSameSite()

The cookie's same-site value.

public setSameSite(string $sameSite) : mixed
Parameters
$sameSite : string

setSecure()

Whether this cookie requires a secure connection (https). Defaults to false if omitted.

public setSecure(bool $secure) : mixed
Parameters
$secure : bool

toArray()

public toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>

validateCookieName()

protected validateCookieName(string $name) : mixed
Parameters
$name : string

validateCookieValue()

protected validateCookieValue(string $value) : mixed
Parameters
$value : string

        
On this page

Search results