用户
 找回密码
 入住 CI 中国社区
搜索
查看: 1525|回复: 0
收起左侧

[HELP] $this->config->set_item('csrf_protection', TRUE); 无效

[复制链接]
发表于 2017-12-2 15:02:44 | 显示全部楼层 |阅读模式
本帖最后由 mx89360944 于 2017-12-2 15:09 编辑

在config.php里$config['csrf_protection'] = TRUE; 可以,。。

$this->config->set_item('csrf_protection', TRUE); 这样设置无效 , 其他的config里的参数都能生效, 就csrf_protection这个不行
PHP复制代码
$this->config->set_item('base_url', _URL_);
                $this->config->set_item('encryption_key', hex2bin(_ENCRYPTION_KEY_));
                $this->config->set_item('time_reference', date_default_timezone_set(_TIME_ZONE_));
 
                //safe
                $this->config->set_item('global_xss_filtering', TRUE);
                $this->config->set_item('csrf_protection', TRUE); //这个无效!!!!!!
 
                //session
                $this->config->set_item('sess_cookie_name', "5KcKlJZ3");
                $this->config->set_item('sess_driver', "database");
                $this->config->set_item('sess_save_path', "i_sessions");
 
                //cookie
                $this->config->set_item('cookie_secure', TRUE);
复制代码



前台页面
value生成不了值,  在config.php里把csrf_protection设置成TRUE,就正常
PHP复制代码
[color=#881280]<input type="hidden" name="ci_csrf_token" value="" />
 
复制代码


本版积分规则