<legend id='20oc4'><style id='20oc4'><dir id='20oc4'><q id='20oc4'></q></dir></style></legend>
      <bdo id='20oc4'></bdo><ul id='20oc4'></ul>
      <i id='20oc4'><tr id='20oc4'><dt id='20oc4'><q id='20oc4'><span id='20oc4'><b id='20oc4'><form id='20oc4'><ins id='20oc4'></ins><ul id='20oc4'></ul><sub id='20oc4'></sub></form><legend id='20oc4'></legend><bdo id='20oc4'><pre id='20oc4'><center id='20oc4'></center></pre></bdo></b><th id='20oc4'></th></span></q></dt></tr></i><div id='20oc4'><tfoot id='20oc4'></tfoot><dl id='20oc4'><fieldset id='20oc4'></fieldset></dl></div>
    1. <tfoot id='20oc4'></tfoot>

      <small id='20oc4'></small><noframes id='20oc4'>

      1. Codeigniter CSRF 令牌问题

        Codeigniter CSRF token problem(Codeigniter CSRF 令牌问题)
        • <bdo id='ZtLQx'></bdo><ul id='ZtLQx'></ul>
          <tfoot id='ZtLQx'></tfoot>

              <legend id='ZtLQx'><style id='ZtLQx'><dir id='ZtLQx'><q id='ZtLQx'></q></dir></style></legend>

              <small id='ZtLQx'></small><noframes id='ZtLQx'>

                  <tbody id='ZtLQx'></tbody>
                <i id='ZtLQx'><tr id='ZtLQx'><dt id='ZtLQx'><q id='ZtLQx'><span id='ZtLQx'><b id='ZtLQx'><form id='ZtLQx'><ins id='ZtLQx'></ins><ul id='ZtLQx'></ul><sub id='ZtLQx'></sub></form><legend id='ZtLQx'></legend><bdo id='ZtLQx'><pre id='ZtLQx'><center id='ZtLQx'></center></pre></bdo></b><th id='ZtLQx'></th></span></q></dt></tr></i><div id='ZtLQx'><tfoot id='ZtLQx'></tfoot><dl id='ZtLQx'><fieldset id='ZtLQx'></fieldset></dl></div>
                  本文介绍了Codeigniter CSRF 令牌问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我创建了一个简单的注册/新闻通讯网站,但我遇到了一个奇怪的问题.有些人收到一个错误提示

                  I've made a simple signup/newsletter site, but I've got a weird problem. Some people get a error that says

                  遇到错误 操作您的请求不被允许.

                  An Error Was Encountered The action you have requested is not allowed.

                  我已经尝试过 google,发现当 CSRF 设置为 true 时人们也遇到了同样的问题.然而,我不会发生在每个人身上,只是一小部分人.我正在使用 form_open 和 form_close,我可以看到隐藏字段(令牌).

                  I've already tried google and found that people had the same problem when CSRF was set to true. However, i doesn't happens to everyone, just a small group of people. I'm using form_open and form_close and i can see the hidden field (token).

                  我正在使用最新版本的 Codeigniter 2.0.2

                  I'm using the latest version of Codeigniter 2.0.2

                  这是我的控制器

                      function __construct() {
                      parent::__construct();
                      session_start();
                  }
                  
                  function index() {
                  
                      $this->load->model('beta_signup_model');
                  
                      $this->form_validation->set_rules('mail','e-mail','required|valid_email|xss_clean|callback__mail_check');
                  
                      // Check for errors
                      if($this->form_validation->run() == FALSE) {
                  
                          // The system found a form validation error
                  
                  
                      } else {
                  
                          // No errors found
                          $_SESSION['mail_success'] = 1;
                          $_SESSION['mail'] = $this->input->post('mail');
                  
                          redirect(base_url() . 'confirm');
                  
                      }
                  
                      ///// FILLS OUT INPUT FIELDS /////
                  
                      // Loads field_populator_helper
                      $this->load->helper('field_populator_helper');
                  
                      // Defines input field names
                      $input_names = array(
                                      'mail',
                      );
                  
                      // Defines default values   
                      $default_values = array(
                                      'Skriv inn e-posten din..',
                      );
                  
                      // Auto-populates fields with blur and focus
                      $data['field_populator'] = populateFields($input_names, $default_values);
                  
                      $this->load->view('frontpage_view', $data);
                  
                  }
                  

                  推荐答案

                  我遇到了同样的问题:在 MAMP 上完全干净地安装 CI 2.1.0,并按照用户指南中的教程进行操作.

                  I had the same problem: totally clean instal of CI 2.1.0, on MAMP, and just following along the tutorial in the User Guide.

                  经过大量搜索和谷歌搜索,我发现在'application/config.php'中,变量$config['cookie_prefix']必须始终设置为空,否则如果打开CSRF保护,则会出现此错误发生.

                  After a lot of searching and googling, I found that in 'application/config.php', the variable $config['cookie_prefix'] must always be set to empty, otherwise if CSRF protection is turned on, this error will occur.

                  可能还涉及其他问题 - 即会话库、加密或 XSS 保护等 - 但只是将cookie_prefix"留空似乎已经为我排序了.

                  It could be that there are other issues involved - ie., session library, encryption or XSS protection, etc. - but just leaving the 'cookie_prefix' empty seems to have sorted it for me.

                  我希望这对其他人有所帮助.

                  I hope this helps others.

                  这篇关于Codeigniter CSRF 令牌问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                  PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)
                    <tbody id='4WFol'></tbody>
                    <bdo id='4WFol'></bdo><ul id='4WFol'></ul>

                      <i id='4WFol'><tr id='4WFol'><dt id='4WFol'><q id='4WFol'><span id='4WFol'><b id='4WFol'><form id='4WFol'><ins id='4WFol'></ins><ul id='4WFol'></ul><sub id='4WFol'></sub></form><legend id='4WFol'></legend><bdo id='4WFol'><pre id='4WFol'><center id='4WFol'></center></pre></bdo></b><th id='4WFol'></th></span></q></dt></tr></i><div id='4WFol'><tfoot id='4WFol'></tfoot><dl id='4WFol'><fieldset id='4WFol'></fieldset></dl></div>
                      • <small id='4WFol'></small><noframes id='4WFol'>

                            <tfoot id='4WFol'></tfoot>

                            <legend id='4WFol'><style id='4WFol'><dir id='4WFol'><q id='4WFol'></q></dir></style></legend>