@@ -5,7 +5,12 @@ Cookie Helper
5
5
The Cookie Helper file contains functions that assist in working with
6
6
cookies.
7
7
8
- .. contents :: Page Contents
8
+ .. contents ::
9
+ :local:
10
+
11
+ .. raw :: html
12
+
13
+ <div class =" custom-index container" ></div >
9
14
10
15
Loading this Helper
11
16
===================
@@ -14,14 +19,16 @@ This helper is loaded using the following code::
14
19
15
20
$this->load->helper('cookie');
16
21
22
+ Available Functions
23
+ ===================
24
+
17
25
The following functions are available:
18
26
19
- set_cookie()
20
- ============
21
27
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]]]]]]] )
23
29
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
25
32
:param string $value: Cookie value
26
33
:param int $expire: Number of seconds until expiration
27
34
:param string $domain: Cookie domain (usually: .yourdomain.com)
@@ -31,26 +38,22 @@ set_cookie()
31
38
:param bool $httponly: Whether to hide the cookie from JavaScript
32
39
:returns: void
33
40
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() ``.
38
45
39
- get_cookie()
40
- ============
41
46
42
47
.. function :: get_cookie($index = '', $xss_clean = FALSE)
43
48
44
49
:param string $index: Cookie name
45
50
:param bool $xss_clean: Whether to apply XSS filtering to the returned value
46
51
:returns: mixed
47
52
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() ``.
51
56
52
- delete_cookie()
53
- ===============
54
57
55
58
.. function :: delete_cookie($name = '', $domain = '', $path = '/', $prefix = '')
56
59
@@ -60,18 +63,18 @@ delete_cookie()
60
63
:param string $prefix: Cookie name prefix
61
64
:returns: void
62
65
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.
65
68
66
- ::
69
+ ::
67
70
68
- delete_cookie('name');
71
+ delete_cookie('name');
69
72
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.
74
77
75
- ::
78
+ ::
76
79
77
- delete_cookie($name, $domain, $path, $prefix)
80
+ delete_cookie($name, $domain, $path, $prefix)
0 commit comments