|  | 
 
| 本帖最后由 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="" />
 
 | 
 |