class JInputCookie extends JInput


Located at : UKNOWVA_ROOT/libraries/joomla/application/input/cookie.php

Joomla! Input Cookie Class

Methods

__construct(array $source = null, array $options = array())

Constructor.

__get(mixed $name)

Magic method to get an input object

from JInput
mixed
get(string $name, mixed $default = null, string $filter = 'cmd')

Gets a value from the input data.

from JInput
mixed
getArray(array $vars, mixed $datasource = null)

Gets an array of values from the request.

from JInput
void
set(string $name, mixed $value, int $expire, string $path = '', string $domain = '', boolean $secure = false, boolean $httpOnly = false)

Sets a value

boolean
__call(mixed $name, string $arguments)

Magic method to get filtered input data.

from JInput
string
getMethod(mixed $name, string $arguments)

Gets the request method.

from JInput

Details

at line 33
JInput __construct(array $source = null, array $options = array())

Constructor.

Parameters

array $source Source data (Optional, default is $_REQUEST)
array $options Array of configuration parameters (Optional)

Return Value

JInput

in JInput at line 96
JInput __get(mixed $name)

Magic method to get an input object

Parameters

mixed $name Name of the input object to retrieve.

Return Value

JInput The request input object

in JInput at line 128
mixed get(string $name, mixed $default = null, string $filter = 'cmd')

Gets a value from the input data.

Parameters

string $name Name of the value to get.
mixed $default Default value to return if variable does not exist.
string $filter Filter to apply to the value.

Return Value

mixed The filtered input value.

in JInput at line 147
mixed getArray(array $vars, mixed $datasource = null)

Gets an array of values from the request.

Parameters

array $vars Associative array of keys and filter types to apply.
mixed $datasource Array to retrieve data from, or null

Return Value

mixed The filtered input data.

at line 86
void set(string $name, mixed $value, int $expire, string $path = '', string $domain = '', boolean $secure = false, boolean $httpOnly = false)

Sets a value

Parameters

string $name Name of the value to set.
mixed $value Value to assign to the input.
int $expire The time the cookie expires. This is a Unix timestamp so is in number of seconds since the epoch. In other words, you'll most likely set this with the time() function plus the number of seconds before you want it to expire. Or you might use mktime(). time()+606024*30 will set the cookie to expire in 30 days. If set to 0, or omitted, the cookie will expire at the end of the session (when the browser closes).
string $path The path on the server in which the cookie will be available on. If set to '/', the cookie will be available within the entire domain. If set to '/foo/', the cookie will only be available within the /foo/ directory and all sub-directories such as /foo/bar/ of domain. The default value is the current directory that the cookie is being set in.
string $domain The domain that the cookie is available to. To make the cookie available on all subdomains of example.com (including example.com itself) then you'd set it to '.example.com'. Although some browsers will accept cookies without the initial ., RFC 2109 requires it to be included. Setting the domain to 'www.example.com' or '.www.example.com' will make the cookie only available in the www subdomain.
boolean $secure Indicates that the cookie should only be transmitted over a secure HTTPS connection from the client. When set to TRUE, the cookie will only be set if a secure connection exists. On the server-side, it's on the programmer to send this kind of cookie only on secure connection (e.g. with respect to $_SERVER["HTTPS"]).
boolean $httpOnly When TRUE the cookie will be made accessible only through the HTTP protocol. This means that the cookie won't be accessible by scripting languages, such as JavaScript. This setting can effectively help to reduce identity theft through XSS attacks (although it is not supported by all browsers).

Return Value

void

See also

setcookie()

in JInput at line 195
boolean __call(mixed $name, string $arguments)

Magic method to get filtered input data.

Parameters

mixed $name Name of the value to get.
string $arguments Default value to return if variable does not exist.

Return Value

boolean The filtered boolean input value.

in JInput at line 220
string getMethod(mixed $name, string $arguments)

Gets the request method.

Parameters

mixed $name Name of the value to get.
string $arguments Default value to return if variable does not exist.

Return Value

string The request method.