form multiple submittion – multiple http requests (something with mod_rewrite?)
- richard
- Member | 60
Hello,
I have a problem, not too sure if this is related to Nette but I have not
experienced this with simple PHP page.
There is a form which submits data, saves the entry into a database and redirect
to another page. What I have found is that sometimes I have the same request
logged in the database twice with a time difference of few (5–20) seconds.
I am sure that the script flow itself does not have anything in that it could
cause these duplicates. I have even disabled refresh button and F5 by js after
the submit button is clicked to prevent refresh before the redirection page is
load up. Users swear that they do not do refresh or anything, they submit once.
I cannot provide reproducible example as this is somewhat random, I'd say less
then 1 percent of cases. I was never able to reproduce this myself.
I am about to write a simple stress test and add some token verification to the
script but I would like to ask whether you have experienced something similar
and what should I focus on…
Thank you in advance.
Btw this is windows server with apache and openssl and mysql on the same machine and the script is non-ajax.
Last edited by richard (2013-12-19 04:31)
- petr.pavel
- Member | 535
Did you verify that the duplicities are created by repeated requests? I mean, did you check the server log? Could be a rogue proxy.
- richard
- Member | 60
Thanks and sorry for late reply.
Yes they are duplicate http requests and at these days I am not receiving any complains. To me it looks like the problem appears to be somehow location related – so it looks more like bunch of users physically from the same place at the same time. I know nothing about network, so I have no idea if the request can be cloned somewhere on a way to server… However I did not want to hack around without knowing the cause and being able to reproduce it, so I leave it at this moment for more evidence.
I have found this:
If an HTTP/1.1 client sends a request which includes a request body, but
which does not include an Expect request-header field with the
“100-continue” expectation, and if the client is not directly connected to
an HTTP/1.1 origin server, and if the client sees the connection close before
receiving any status from the server, the client SHOULD retry the
request.
tbh I do not know what is said here…