Skip to content

Validate AJAX Request

Gunjan Patel edited this page Jun 3, 2016 · 1 revision

Client Side Javascript

// This will gives you an url with valid and unique token
var url = redSHOP.RSConfig._('AJAX_BASE_URL');

// This will gives you token which you can use individually.
var token = redSHOP.RSConfig._('AJAX_TOKEN');

Server side - PHP

// This will validate using GET method
RedshopHelperAjax::validateAjaxRequest('get');

// This will validate method using POST method.
RedshopHelperAjax::validateAjaxRequest();

If request is not valid AJAX request then it will throw and 403 Forbidden Access exception.


Since version 1️⃣.6️⃣.1️⃣

Clone this wiki locally