silverstripe-userforms/javascript/UserForm_frontend.js
Mateusz Uzdowski bcd9083d1c BUGFIX: prevent form from expiring on users - ping regularly.
The form throws a CSRF error if left for too long by itself. This is
especially important for long forms.

Use local ping function, as the CMS ping returns 403 when BasicAuth is
enabled.
2012-09-11 10:12:15 +12:00

10 lines
204 B
JavaScript

jQuery(function($) {
/**
* Make sure the form does not expire on the user.
*/
setInterval(function() {
// Ping every 3 mins.
$.ajax({url: "UserDefinedForm_Controller/ping"});
}, 180*1000);
});