Hi,
A large form on a SS 3.1 site has been working without hiccup. Lately though, I intermittently get the following error:
"There seems to have been a technical problem. Please click the back button refresh your browser, and try again."
Doing the following did not make a difference:
- Clearing the browser cache
- Flushing silverstripe cache (or manually deleting cache folder contents)
- Restarting the browser
- Restarting the web server
It has occurred more frequently on my dev machine (MAMP Pro) and now has occurred on the production server (Linux). And strangely it only seems to be occurring on Safari (able to replicate error on desktop / iPad). It has only started to occur recently. Some recent changes made include adding more fields to the form, changing the system temp directory and php session folder. I can confirm that the sessions folder is where I want it to be because of the newly written session files. If I open the form up, sleep the computer / device,
Just as quickly as it occurs, it stops - and I have no idea why!
The following CSRF protection code in Form.php (~ line 280) is where the error occurs:
// Protection against CSRF attacks
$token = $this->getSecurityToken();
if(!$token->checkRequest($request)) {
$this->httpError(400, _t("Form.CSRF_FAILED_MESSAGE",
"There seems to have been a technical problem. Please click the back button,"
. " refresh your browser, and try again."));
}
Debugging and stepping through the code confirms that there is a mismatch in the tokens. But why? Any idea why this could be occurring?
Many thanks,
VWD.
Posted to: Intermittent (CSRF) error on form submission: "There seems to have been a technical problem. Please click the back button refresh your browser, and try again." | Show Thread | Post Reply