Index: system/helpers/cookie_helper.php
===================================================================
--- system/helpers/cookie_helper.php	(revision 1203)
+++ system/helpers/cookie_helper.php	(working copy)
@@ -40,15 +40,16 @@
  * @param	string	the cookie domain.  Usually:  .yourdomain.com
  * @param	string	the cookie path
  * @param	string	the cookie prefix
+ * @param   bool    secure cookie
  * @return	void
  */
 if ( ! function_exists('set_cookie'))
 {
-	function set_cookie($name = '', $value = '', $expire = '', $domain = '', $path = '/', $prefix = '')
+	function set_cookie($name = '', $value = '', $expire = '', $domain = '', $path = '/', $prefix = '', $secure = FALSE)
 	{
 		if (is_array($name))
 		{		
-			foreach (array('value', 'expire', 'domain', 'path', 'prefix', 'name') as $item)
+			foreach (array('value', 'expire', 'domain', 'path', 'prefix', 'name', 'secure') as $item)
 			{
 				if (isset($name[$item]))
 				{
@@ -72,7 +73,10 @@
 		{
 			$path = $CI->config->item('cookie_path');
 		}
-		
+        if ($secure === FALSE AND $CI->config->item('cookie_secure') === TRUE)
+        {
+            $secure = $CI->config->item('cookie_secure');
+        }
 		if ( ! is_numeric($expire))
 		{
 			$expire = time() - 86500;
@@ -89,7 +93,7 @@
 			}
 		}
 	
-		setcookie($prefix.$name, $value, $expire, $path, $domain, 0);
+		setcookie($prefix.$name, $value, $expire, $path, $domain, $secure);
 	}
 }
 	
@@ -133,4 +137,4 @@
 
 
 /* End of file cookie_helper.php */
-/* Location: ./system/helpers/cookie_helper.php */
\ No newline at end of file
+/* Location: ./system/helpers/cookie_helper.php */
Index: system/application/config/config.php
===================================================================
--- system/application/config/config.php	(revision 1203)
+++ system/application/config/config.php	(working copy)
@@ -248,11 +248,13 @@
 | 'cookie_prefix' = Set a prefix if you need to avoid collisions
 | 'cookie_domain' = Set to .your-domain.com for site-wide cookies
 | 'cookie_path'   =  Typically will be a forward slash
+| 'cookie_secure  = Use secure cookies
 |
 */
 $config['cookie_prefix']	= "";
 $config['cookie_domain']	= "";
 $config['cookie_path']		= "/";
+$config['cookie_secure']	= FALSE;
 
 /*
 |--------------------------------------------------------------------------
@@ -313,4 +315,4 @@
 
 
 /* End of file config.php */
-/* Location: ./system/application/config/config.php */
\ No newline at end of file
+/* Location: ./system/application/config/config.php */
Index: system/libraries/Session.php
===================================================================
--- system/libraries/Session.php	(revision 1203)
+++ system/libraries/Session.php	(working copy)
@@ -311,7 +311,7 @@
 					$this->sess_length + time(),
 					$this->CI->config->item('cookie_path'),
 					$this->CI->config->item('cookie_domain'),
-					0
+					$this->CI->config->item('cookie_secure'),
 				);
 	}
 	
@@ -399,7 +399,7 @@
 					($this->now - 31500000),
 					$this->CI->config->item('cookie_path'),
 					$this->CI->config->item('cookie_domain'),
-					0
+					$this->CI->config->item('cookie_secure'),
 				);
 	}
 	
@@ -651,4 +651,4 @@
 // END Session Class
 
 /* End of file Session.php */
-/* Location: ./system/libraries/Session.php */
\ No newline at end of file
+/* Location: ./system/libraries/Session.php */

