From 9898b892baed8d20f4138cb88c4f4ca3a082e444 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 10 Mar 2010 14:04:17 -0600 Subject: added Security class docs, cleaned up Input class for changes to both --- user_guide/helpers/cookie_helper.html | 44 ++--------------------------------- 1 file changed, 2 insertions(+), 42 deletions(-) (limited to 'user_guide/helpers/cookie_helper.html') diff --git a/user_guide/helpers/cookie_helper.html b/user_guide/helpers/cookie_helper.html index b73daf664..d7120d511 100644 --- a/user_guide/helpers/cookie_helper.html +++ b/user_guide/helpers/cookie_helper.html @@ -70,53 +70,13 @@ Cookie Helper

set_cookie()

-

Sets a cookie containing the values you specify. There are two ways to pass information to this function so that a cookie can be set: -Array Method, and Discrete Parameters:

- -

Array Method

- -

Using this method, an associative array is passed to the first parameter:

- -$cookie = array(
-                   'name'   => 'The Cookie Name',
-                   'value'  => 'The Value',
-                   'expire' => '86500',
-                   'domain' => '.some-domain.com',
-                   'path'   => '/',
-                   'prefix' => 'myprefix_',
-               );
-
-set_cookie($cookie); -
- -

Notes:

- -

Only the name and value are required. To delete a cookie set it with the expiration blank.

- -

The expiration is set in seconds, which will be added to the current time. Do not include the time, but rather only the -number of seconds from now that you wish the cookie to be valid. If the expiration is set to -zero the cookie will only last as long as the browser is open.

-

For site-wide cookies regardless of how your site is requested, add your URL to the domain starting with a period, like this: .your-domain.com

-

The path is usually not needed since the function sets a root path.

-

The prefix is only needed if you need to avoid name collisions with other identically named cookies for your server.

- -

Discrete Parameters

- -

If you prefer, you can set the cookie by passing data using individual parameters:

- -set_cookie($name, $value, $expire, $domain, $path, $prefix); +

This helper function gives you view file friendly syntax to set browser cookies. Refer to the Input class for a description of use, as this function is an alias to $this->input->set_cookie().

get_cookie()

-

Lets you fetch a cookie. The first parameter will contain the name of the cookie you are looking for (including any prefixes):

- -get_cookie('some_cookie'); - -

The function returns FALSE (boolean) if the item you are attempting to retrieve does not exist.

+

This helper function gives you view file friendly syntax to get browser cookies. Refer to the Input class for a description of use, as this function is an alias to $this->input->cookie().

-

The second optional parameter lets you run the data through the XSS filter. It's enabled by setting the second parameter to boolean TRUE;

-

get_cookie('some_cookie', TRUE);

delete_cookie()

Lets you delete a cookie. Unless you've set a custom path or other values, only the name of the cookie is needed:

-- cgit v1.2.3-24-g4f1b