Skip to content

Commit b55d981

Browse files
author
Derek Jones
committed
Update Cookie helper docs
1 parent 333ad2e commit b55d981

File tree

1 file changed

+29
-26
lines changed

1 file changed

+29
-26
lines changed

user_guide_src/source/helpers/cookie_helper.rst

Lines changed: 29 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@ Cookie Helper
55
The Cookie Helper file contains functions that assist in working with
66
cookies.
77

8-
.. contents:: Page Contents
8+
.. contents::
9+
:local:
10+
11+
.. raw:: html
12+
13+
<div class="custom-index container"></div>
914

1015
Loading this Helper
1116
===================
@@ -14,14 +19,16 @@ This helper is loaded using the following code::
1419

1520
$this->load->helper('cookie');
1621

22+
Available Functions
23+
===================
24+
1725
The following functions are available:
1826

19-
set_cookie()
20-
============
2127

22-
.. function:: set_cookie($name = '', $value = '', $expire = '', $domain = '', $path = '/', $prefix = '', $secure = FALSE, $httponly = FALSE)
28+
.. function:: set_cookie($name = ''[, $value = ''[, $expire = ''[, $domain = ''[, $path = '/'[, $prefix = ''[, $secure = FALSE[, $httponly = FALSE]]]]]]])
2329

24-
:param string $name: Cookie name
30+
:param mixed $name: Cookie name *or* associative array of all of
31+
the parameters available to this function
2532
:param string $value: Cookie value
2633
:param int $expire: Number of seconds until expiration
2734
:param string $domain: Cookie domain (usually: .yourdomain.com)
@@ -31,26 +38,22 @@ set_cookie()
3138
:param bool $httponly: Whether to hide the cookie from JavaScript
3239
:returns: void
3340

34-
This helper function gives you view file friendly syntax to set browser
35-
cookies. Refer to the :doc:`Input Library <../libraries/input>` for a
36-
description of its use, as this function is an alias for
37-
``CI_Input::set_cookie()``.
41+
This helper function gives you view file friendly syntax to set browser
42+
cookies. Refer to the :doc:`Input Library <../libraries/input>` for a
43+
description of its use, as this function is an alias for
44+
``CI_Input::set_cookie()``.
3845

39-
get_cookie()
40-
============
4146

4247
.. function:: get_cookie($index = '', $xss_clean = FALSE)
4348

4449
:param string $index: Cookie name
4550
:param bool $xss_clean: Whether to apply XSS filtering to the returned value
4651
:returns: mixed
4752

48-
This helper function gives you view file friendly syntax to get browser
49-
cookies. Refer to the :doc:`Input Library <../libraries/input>` for a
50-
description of itsuse, as this function is an alias for ``CI_Input::cookie()``.
53+
This helper function gives you view file friendly syntax to get browser
54+
cookies. Refer to the :doc:`Input Library <../libraries/input>` for a
55+
description of its use, as this function is an alias for ``CI_Input::cookie()``.
5156

52-
delete_cookie()
53-
===============
5457

5558
.. function:: delete_cookie($name = '', $domain = '', $path = '/', $prefix = '')
5659

@@ -60,18 +63,18 @@ delete_cookie()
6063
:param string $prefix: Cookie name prefix
6164
:returns: void
6265

63-
Lets you delete a cookie. Unless you've set a custom path or other
64-
values, only the name of the cookie is needed.
66+
Lets you delete a cookie. Unless you've set a custom path or other
67+
values, only the name of the cookie is needed.
6568

66-
::
69+
::
6770

68-
delete_cookie('name');
71+
delete_cookie('name');
6972

70-
This function is otherwise identical to ``set_cookie()``, except that it
71-
does not have the value and expiration parameters. You can submit an
72-
array of values in the first parameter or you can set discrete
73-
parameters.
73+
This function is otherwise identical to ``set_cookie()``, except that it
74+
does not have the value and expiration parameters. You can submit an
75+
array of values in the first parameter or you can set discrete
76+
parameters.
7477

75-
::
78+
::
7679

77-
delete_cookie($name, $domain, $path, $prefix)
80+
delete_cookie($name, $domain, $path, $prefix)

0 commit comments

Comments
 (0)