From d8d1e24eee56d2466c91ecd72b3c8932eb3d0639 Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Wed, 16 Feb 2011 17:23:16 +0000 Subject: Secure cookies can now be made with the set_cookie() helper and Input Class method. --- user_guide/libraries/input.html | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'user_guide/libraries/input.html') diff --git a/user_guide/libraries/input.html b/user_guide/libraries/input.html index 4faecd768..844e99ab8 100644 --- a/user_guide/libraries/input.html +++ b/user_guide/libraries/input.html @@ -187,13 +187,14 @@ Array Method, and Discrete Parameters:

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_',
-               );
+    'name'   => 'The Cookie Name',
+    'value'  => 'The Value',
+    'expire' => '86500',
+    'domain' => '.some-domain.com',
+    'path'   => '/',
+    'prefix' => 'myprefix_',
+    'secure' => TRUE
+);

$this->input->set_cookie($cookie);
@@ -208,12 +209,13 @@ 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.

+

The secure boolean is only needed if you want to make it a secure cookie by setting it to TRUE.

Discrete Parameters

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

-$this->input->set_cookie($name, $value, $expire, $domain, $path, $prefix); +$this->input->set_cookie($name, $value, $expire, $domain, $path, $prefix, $secure);

$this->input->get_cookie()

-- cgit v1.2.3-24-g4f1b