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
$httpOnly
Indicates if the cookie is only accessible through the HTTP protocol.
public bool $httpOnly = false
$secure
Indicates if the cookie should only be transmitted over a secure HTTPS connection.
public bool $secure = false
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.