You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a known bug with the url helper methods when serving the site in a sub-folder. It's being worked on but one of the cases gets a bit tricky and I'm trying to track it down.
So - yes, it's a bug. But not with CSRF, it's with the base_url() and/or site_url() helpers and how IncomingRequest interprets the original URI when in a sub-folder.
Im asking about this because i am not sure if it is a bug or i am doing something wrong with the csrf or not doing.
I have this setup.
public $CSRFRegenerate = true;
public $CSRFRedirect = true;
i have enabled the filter csrf to be available in the global before.
I have created this routes
i have created this controller Contact with methods index() and contact()
i have the project inside a folder named projects
/projects/ci4 - codeigniter 4 project
and the index page
/projects/ci4index with htaccess
So until now everything works perfectly, i intended this error to happen to see what it does.
I DID NOT put the CSRF token inside the form, to let codeigniter REDIRECT BACK.
But when this happens with this code from the CSRF Filter
$security = Services::security();
The problem here is i get redirected back on an inexistent page.
From url : projects.domain/ci4index/contact
To url : projects.domain/contact
I think here it should go back to projects.domain/ci4index/contact
right ?
This is a problem right ?
The text was updated successfully, but these errors were encountered: