Allow the Cross Origin Request (CORS)

Author - Maniraj Singh

Cross Origin issue is resolved by adding header(“Access-Control-Allow-Origin:”); to allow the particular origin or we can also allow all the origin by replacing the path to *.

For Cake php header is defined in file public/index.php.



To view the origin is allowed or not then check the request header from network panel.

Response Headers:


Alternative: The problem is also resolved by defining middleware to

Route (

If in any case ajax request shows method not allowed then check the Request method defined in ajax request and confirm on headers (showing in above image).

Webner Solutions is a Software Development company focused on developing Insurance Agency Management Systems, Learning Management Systems and Salesforce apps. Contact us at for your Insurance, eLearning and Salesforce applications.

Leave a Reply

Your email address will not be published.