Welcome Guest, Not a member yet? Register   Sign In
Error on activating CSRF protection
#1

(This post was last modified: 01-21-2017, 08:04 AM by BabalooAye. Edit Reason: Increase information )

I'm getting the following error message when I set $config['csrf_protection'] = TRUE:



Code:
Fatal error: Class 'CI_Controller' not found in /opt/codeigniter/system/core/CodeIgniter.php on line 369
A PHP Error was encountered

Severity: Error

Message: Class 'CI_Controller' not found

Filename: core/CodeIgniter.php

Line Number: 369

Backtrace:

I'm following the manual, but I can't see clear cause for it.

By the way, it only happens when I try to reload by F5 a FORM submited with POST. I know that an error is expected, but I think that it should be shown in an error page (or something), and might be another kind of error.

Anyone can help me out?
Reply
#2

My problem is that I modified the "views/errors/error_general.php" to dynamize reporting responses getting variables from CI instance, then, someway, the error response from CSRF protection become misconfigured.

Apparently, this file can not see CI instance, so it is not possible to use instance references in it.

This was fixed by returning the file "views/errors/error_general.php" to the original version, but I'm still studying ways to customize it.

Thanks for the attention.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB