Since: 1.7.0

class Cookie extends Input

deprecated 4.3 will be removed in 6.0. Use Joomla\Input\Cookie instead

Joomla! Input Cookie Class

Properties

protected Input[] deprecated Since: 1.7.0
$inputs

Input objects

from  Input
Input read-only $get from  Input
Input read-only $post from  Input
Input read-only $request from  Input
Input read-only $server from  Input
Input read-only $env from  Input
Files read-only $files from  Input
$cookie from  Input
Json read-only $json from  Input

Methods

__construct(array $source = null, array $options = []) deprecated

Constructor.

Input
__get(mixed $name) deprecated

Magic method to get an input object

from  Input
mixed
getArray(array $vars = [], mixed $datasource = null, string $defaultFilter = 'unknown') deprecated

Gets an array of values from the request.

from  Input
mixed
getArrayRecursive(array $vars = [], mixed $datasource = null, string $defaultFilter = 'unknown', bool $recursion = false) deprecated

Gets an array of values from the request.

from  Input
void
unserialize(string $input) deprecated

Method to unserialize the input.

from  Input
void
set(string $name, mixed $value, array $options = []) deprecated

Sets a value

Details

__construct(array $source = null, array $options = []) deprecated

Since: 1.7.0

deprecated 4.3 will be removed in 6.0. Use Joomla\Input\Cookie instead

Constructor.

Parameters

array $source

Source data (Optional, default is $_REQUEST)

array $options

Array of configuration parameters (Optional)

Input __get(mixed $name) deprecated

Since: 1.7.0

deprecated 4.3 will be removed in 6.0. Use Joomla\Input\Input instead

Magic method to get an input object

Parameters

mixed $name

Name of the input object to retrieve.

Return Value

Input

The request input object

mixed getArray(array $vars = [], mixed $datasource = null, string $defaultFilter = 'unknown') deprecated

Since: 1.7.0

deprecated 4.3 will be removed in 6.0. Use Joomla\Input\Input instead

Gets an array of values from the request.

Parameters

array $vars

Associative array of keys and filter types to apply. If empty and datasource is null, all the input data will be returned but filtered using the filter given by the parameter defaultFilter in InputFilter::clean.

mixed $datasource

Array to retrieve data from, or null.

string $defaultFilter

Default filter used in InputFilter::clean if vars is empty and datasource is null. If 'unknown', the default case is used in InputFilter::clean.

Return Value

mixed

The filtered input data.

protected mixed getArrayRecursive(array $vars = [], mixed $datasource = null, string $defaultFilter = 'unknown', bool $recursion = false) deprecated

Since: 3.4.2

deprecated 4.3 will be removed in 6.0. Use Joomla\Input\Input instead

Gets an array of values from the request.

Parameters

array $vars

Associative array of keys and filter types to apply. If empty and datasource is null, all the input data will be returned but filtered using the filter given by the parameter defaultFilter in InputFilter::clean.

mixed $datasource

Array to retrieve data from, or null.

string $defaultFilter

Default filter used in InputFilter::clean if vars is empty and datasource is null. If 'unknown', the default case is used in InputFilter::clean.

bool $recursion

Flag to indicate a recursive function call.

Return Value

mixed

The filtered input data.

void unserialize(string $input) deprecated

Since: 3.0.0

deprecated 4.3 will be removed in 6.0. Use Joomla\Input\Input instead

Method to unserialize the input.

Parameters

string $input

The serialized input.

Return Value

void

void set(string $name, mixed $value, array $options = []) deprecated

Since: 1.7.0

deprecated 4.3 will be removed in 6.0. Use Joomla\Input\Cookie instead

Sets a value

Parameters

string $name

Name of the value to set.

mixed $value

Value to assign to the input.

array $options

An associative array which may have any of the keys expires, path, domain, secure, httponly and samesite. The values have the same meaning as described for the parameters with the same name. The value of the samesite element should be either Lax or Strict. If any of the allowed options are not given, their default values are the same as the default values of the explicit parameters. If the samesite element is omitted, no SameSite cookie attribute is set.

Return Value

void

See also

setcookie()