Welcome Guest, Not a member yet? Register   Sign In
Serious issue with c_I 4.1.8 CSRF
#1

(This post was last modified: 02-15-2022, 10:59 PM by luckmoshy.)

Hi All!

I have been curious  for a while about c_I 4.1.8  on
Code:
CSRF

PHP Code:
public $methods = [
    'post' => ['csrf'],
]; 
I detect this issue, but I don't have a sure if other faces  like  me

in
PHP Code:
<PHP echo form_open('controller/method')?> /*This does not accept CRSF to be enabled wether globally or ..*/ 

if I allow
Code:
csrf
the  way does not work at all

if I do
Code:
<form method="post" action="<?PHP echo base_url('controller/method')?>"></form> /*This allow CRSF work*/
this way work , I mean (CRSF) shows =(<input type="hidden" name="csrf_token_name" value="a226a7c4e72640c2e0c5602f2a0c2f69">f) shows

so why In built form does not work if CRSF if  is allowed in (Globally) or
PHP Code:
public $methods = [
    'post' => ['csrf'],
]; 
Codeigniter First, Codeigniter Then You!!
yekrinaDigitals

Reply
#2

(This post was last modified: 02-16-2022, 03:04 AM by kenjis.)

Sorry, I don't get what you say.

But if you use to set csrf filter with $methods and only 'post', you have to add csrf token manually.

Quote:To use auto-generation of CSRF field, you need to turn CSRF filter on to the form page. In most cases it is requested using the GET method.
https://codeigniter4.github.io/userguide...html-forms
Reply
#3

(02-16-2022, 03:02 AM)kenjis Wrote: Sorry, I don't get what you say.

But if you use to set csrf filter with $methods and only 'post', you have to add csrf token manually.

Quote:To use auto-generation of CSRF field, you need to turn CSRF filter on to the form page. In most cases it is requested using the GET method.
https://codeigniter4.github.io/userguide...html-forms

good solved by your way thank you
Codeigniter First, Codeigniter Then You!!
yekrinaDigitals

Reply




Theme © iAndrew 2016 - Forum software by © MyBB