Here I meet a little problem with my cakephp I can not activate the CORS. When doing a debugging with the browser I get the following error message: “SEC7120: Origin http://xxxx.fr not found in the Access-Control-Allow-Origin header.” I have done several researches, all the proposed solutions do not work. Here are the solutions found: Adding the following code in header of my page.ctp (does not work)
<?php header("Access-Control-Allow-Origin: *"); ?>
Adding the following code in my controller.php (does not work)
function beforeFilter() {
$this->header(‘Access-Control-Allow-Origin’,’’);
$this->header(‘Access-Control-Allow-Methods’,’’);
$this->header(‘Access-Control-Allow-Headers’,‘X-Requested-With’);
$this->header(‘Access-Control-Allow-Headers’,‘Content-Type, x-xsrf-token’);
$this->header(‘Access-Control-Max-Age’,‘172800’);
}
I come with this post soliciter your help, I specify that I am a beginner in cakephp