added global cookie prefix to get_cookie() unless the cookie exists as-requested
diff --git a/system/helpers/cookie_helper.php b/system/helpers/cookie_helper.php
index d906882..77f86e4 100644
--- a/system/helpers/cookie_helper.php
+++ b/system/helpers/cookie_helper.php
@@ -107,8 +107,14 @@
{
function get_cookie($index = '', $xss_clean = FALSE)
{
- $CI =& get_instance();
- return $CI->input->cookie($index, $xss_clean);
+ $prefix = '';
+
+ if ( ! isset($_COOKIE[$index]) && config_item('cookie_prefix') != '')
+ {
+ $prefix = config_item('cookie_prefix');
+ }
+
+ return $CI->input->cookie($prefix.$index, $xss_clean);
}
}
diff --git a/user_guide/changelog.html b/user_guide/changelog.html
index 5f76c00..65950cd 100644
--- a/user_guide/changelog.html
+++ b/user_guide/changelog.html
@@ -87,6 +87,7 @@
<li>Added ability to force lowercase for <kbd>url_title()</kbd> in the <a href="helpers/url_helper.html">URL helper</a>.</li>
<li>Changed the default "type" of <kbd>form_button()</kbd> to "button" from "submit" in the <a href="helpers/form_helper.html">form helper</a>.</li>
<li>Changed redirect() in the URL helper to allow redirections to URLs outside of the CI site.</li>
+ <li>Updated get_cookie() to try to fetch the cookie using the global cookie prefix if the requested cookie name doesn't exist.</li>
</ul>
</li>
<li>Other Changes