codeigniter CSRF error: “The action you have requested is not allowed.”

后端 未结 14 2321
长发绾君心
长发绾君心 2020-11-28 12:57

I enabled the csrf_protection option in codeigniter\'s config file, and used form_open() function to create my forms. But when I submit the form, this error occurs:

14条回答
  •  攒了一身酷
    2020-11-28 13:27

    Make sure that your BASE_URL matches the URL that you are viewing. I have two aliases (one was created for oauth) and the project works on both aliases, but CSRF will fail if the BASE_URL doesn't match the URL in the browser.

提交回复
热议问题