In a recent project, there was a need to make ajax calls to a remote server in a sequential manner to synchronise data. Each call would wait for the previous one to complete, before triggering the next one. See the code here.
Protecting your CodeIgniter application from CSRF / XSRF attacks is easy, thanks to the framework’s security features. CSRF protection can be enabled in a matter of minutes, and it doesn’t take long to make existing forms and AJAX calls compatible with the feature.CodeIgniter, jQuery, PHP, Security