summaryrefslogtreecommitdiffstats
path: root/system/core/Security.php
diff options
context:
space:
mode:
Diffstat (limited to 'system/core/Security.php')
-rwxr-xr-xsystem/core/Security.php18
1 files changed, 15 insertions, 3 deletions
diff --git a/system/core/Security.php b/system/core/Security.php
index ceef9779c..3617cadcc 100755
--- a/system/core/Security.php
+++ b/system/core/Security.php
@@ -58,8 +58,20 @@ class CI_Security {
*/
public function __construct()
{
- // Append application specific cookie prefix to token name
- $this->_csrf_cookie_name = (config_item('cookie_prefix')) ? config_item('cookie_prefix').$this->_csrf_token_name : $this->_csrf_token_name;
+ // CSRF config
+ foreach(array('csrf_expire', 'csrf_token_name', 'csrf_cookie_name') as $key)
+ {
+ if (FALSE !== ($val = config_item($key)))
+ {
+ $this->{'_'.$key} = $val;
+ }
+ }
+
+ // Append application specific cookie prefix
+ if (config_item('cookie_prefix'))
+ {
+ $this->_csrf_cookie_name = config_item('cookie_prefix').$this->_csrf_cookie_name;
+ }
// Set the CSRF hash
$this->_csrf_set_hash();
@@ -817,4 +829,4 @@ class CI_Security {
// END Security Class
/* End of file Security.php */
-/* Location: ./system/libraries/Security.php */ \ No newline at end of file
+/* Location: ./system/libraries/Security.php */