From d8d1e24eee56d2466c91ecd72b3c8932eb3d0639 Mon Sep 17 00:00:00 2001
From: Phil Sturgeon
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.
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);