diff options
author | Eric Roberts <eric@cryode.com> | 2012-04-15 00:49:21 +0200 |
---|---|---|
committer | Eric Roberts <eric@cryode.com> | 2012-04-15 00:49:21 +0200 |
commit | 8cefb3ff51de4f023753c0146eb16950f48601a9 (patch) | |
tree | ed868ec7a795fcf1fe97efc5642d26dc1d1faefe /system/helpers/cookie_helper.php | |
parent | 0760a48d431fb9ab85f2a0ca9af63aa131e29520 (diff) | |
parent | 0f2211711deceb74157d6811116acc0376d3157d (diff) |
Merge branch 'develop' of https://github.com/EllisLab/CodeIgniter into feature/form_error_msgs
Conflicts:
system/language/english/form_validation_lang.php
Diffstat (limited to 'system/helpers/cookie_helper.php')
-rw-r--r-- | system/helpers/cookie_helper.php | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/system/helpers/cookie_helper.php b/system/helpers/cookie_helper.php index 7b439c47f..06560e723 100644 --- a/system/helpers/cookie_helper.php +++ b/system/helpers/cookie_helper.php @@ -1,13 +1,13 @@ -<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); +<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); /** * CodeIgniter * - * An open source application development framework for PHP 5.1.6 or newer + * An open source application development framework for PHP 5.2.4 or newer * * NOTICE OF LICENSE - * + * * Licensed under the Open Software License version 3.0 - * + * * This source file is subject to the Open Software License (OSL 3.0) that is * bundled with this package in the files license.txt / license.rst. It is * also available through the world wide web at this URL: @@ -25,8 +25,6 @@ * @filesource */ -// ------------------------------------------------------------------------ - /** * CodeIgniter Cookie Helpers * @@ -42,25 +40,26 @@ /** * Set cookie * - * Accepts six parameter, or you can submit an associative + * Accepts seven parameters, or you can submit an associative * array in the first parameter containing all the values. * - * @access public * @param mixed * @param string the value of the cookie * @param string the number of seconds until expiration * @param string the cookie domain. Usually: .yourdomain.com * @param string the cookie path * @param string the cookie prefix + * @param bool true makes the cookie secure + * @param bool true makes the cookie accessible via http(s) only (no javascript) * @return void */ if ( ! function_exists('set_cookie')) { - function set_cookie($name = '', $value = '', $expire = '', $domain = '', $path = '/', $prefix = '', $secure = FALSE) + function set_cookie($name = '', $value = '', $expire = '', $domain = '', $path = '/', $prefix = '', $secure = FALSE, $httponly = FALSE) { // Set the config file options $CI =& get_instance(); - $CI->input->set_cookie($name, $value, $expire, $domain, $path, $prefix, $secure); + $CI->input->set_cookie($name, $value, $expire, $domain, $path, $prefix, $secure, $httponly); } } @@ -69,7 +68,6 @@ if ( ! function_exists('set_cookie')) /** * Fetch an item from the COOKIE array * - * @access public * @param string * @param bool * @return mixed @@ -79,14 +77,7 @@ if ( ! function_exists('get_cookie')) function get_cookie($index = '', $xss_clean = FALSE) { $CI =& get_instance(); - - $prefix = ''; - - if ( ! isset($_COOKIE[$index]) && config_item('cookie_prefix') != '') - { - $prefix = config_item('cookie_prefix'); - } - + $prefix = isset($_COOKIE[$index]) ? '' : config_item('cookie_prefix'); return $CI->input->cookie($prefix.$index, $xss_clean); } } @@ -97,7 +88,7 @@ if ( ! function_exists('get_cookie')) * Delete a COOKIE * * @param mixed - * @param string the cookie domain. Usually: .yourdomain.com + * @param string the cookie domain. Usually: .yourdomain.com * @param string the cookie path * @param string the cookie prefix * @return void @@ -110,6 +101,5 @@ if ( ! function_exists('delete_cookie')) } } - /* End of file cookie_helper.php */ /* Location: ./system/helpers/cookie_helper.php */
\ No newline at end of file |