Den fre. 20. sep. 2019 kl. 13.51 skrev Marc Kaufmann <
marc.kaufman...@gmail.com>:

> Thanks Jens, yes the send/forward seems to at least address a few of the
> cases that I have - not sure if it disallows the forms unless I use
> continuations in the forms (right now I am not, mostly just sending the
> request to the current URL. I'll have to see.
>
> Yes, I worked through and read the Continue tutorial a few times and use
> redirect/get to work around the double submit error. But -- I think -- the
> redirect/get only avoids something like refreshing the page from leading to
> a new submit, although I may be wrong. I thought I used it in some places
> where I was able to go back and resubmit. I should double check, since I am
> not using redirect/get everywhere, so that may be the issue.
>

Yes, the redirect trick only prevents the same data (as the result of a
"submit" action) being sent twice.
If the user goes back to the form, fills in the form again and the click
submit again, a new set
of data is sent.

If you need to prevent the same form being filled in twice, you could
associate a key as
a hidden form value (say the md5 of a counter) and keep track in a database
of which keys
have already been used.

To prevent the key table from getting too large, you can flip it around:
keep the non-used keys in the
database, then on submission remove the key. If you also store the age of
the key, you can
from time to time delete old keys.

/Jens Axel

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CABefVgzZw%2BpkRuP9t6axMJcmpvCKPhda1Jxnaat02XRvG6A1TQ%40mail.gmail.com.

Reply via email to