API Documentation (v0.9.0-alpha)

Avolutions\Http\Cookie

The Cookie class is an object representing an HTTP Cookie. This can be used to store information on the client.

Properties

Property Visibility Type Description
$domain public string The (sub)domain that the cookie is available to.
$expires public int The time the cookie expires as UNIX timestamp.
$httpOnly public bool Indicates if the cookie is only accessible through the HTTP protocol.
$name public string The name of the cookie.
$path public string The path on the server in which the cookie will be available on.
$secure public bool Indicates if the cookie should only be transmitted over a secure HTTPS connection.
$value public string The value of the cookie.

Methods

Method Visibility Description
__construct() public Creates a new Cookie object with the given parameters.

Property Details

$domain

The (sub)domain that the cookie is available to.

public string $domain
$expires

The time the cookie expires as UNIX timestamp.

public int $expires = 0
$httpOnly

Indicates if the cookie is only accessible through the HTTP protocol.

public bool $httpOnly = false
$name

The name of the cookie.

public string $name
$path

The path on the server in which the cookie will be available on.

public string $path
$secure

Indicates if the cookie should only be transmitted over a secure HTTPS connection.

public bool $secure = false
$value

The value of the cookie.

public string $value

Method Details

__construct()

Creates a new Cookie object with the given parameters.

public __construct(string $name, string $value, int $expires[, string $path = '' ][, string $domain = '' ][, bool $secure = false ][, bool $httpOnly = false ]) : mixed
Parameters

string $name
The name of the cookie.

string $value
The value of the cookie.

int $expires
The time the cookie expires as UNIX timestamp.

string $path (optional)
The path on the server in which the cookie will be available on.

string $domain (optional)
The (sub)domain that the cookie is available to.

bool $secure (optional)
Indicates if the cookie should only be transmitted over a secure HTTPS connection.

bool $httpOnly (optional)
Indicates if the cookie is only accessible through the HTTP protocol.