Why is my mobile browser resubmitting POST data silently?

0
2
Asked By CuriousCat93 On

I've set up a simple survey page for my village, and I've been noticing that some users are having their POST submissions resubmitted without meaning to. Typically, when you go back to a page that requires a POST submission, the browser prompts you to resend data. However, users are reporting that after submitting the survey, if they navigate away and then return to the confirmation page—which has the same URL—they receive a message saying they've already submitted their data. This makes me think the browser is resubmitting the POST silently when revisiting the result page, which seems unexpected. Am I missing something? Is this behavior common nowadays?

3 Answers

Answered By TechieTinker On

It sounds like you're running into the classic Post/Redirect/Get (PRG) issue. When a user submits a form and then gets redirected, that helps avoid silent resubmissions. If you handle the POST submission by redirecting them to another page or even reloading the same URL with a GET request, that should solve the problem. It's a common pattern to implement for forms!

Answered By FormMaster99 On

One very straightforward solution is to redirect users after they submit the form. Even if it's to the same URL, just ensure it's GET. This way, if users hit back or refresh, they won't trigger a POST resend.

Answered By OldTimerTech On

Actually, if you’re using standard HTML form submission, refreshing the page can resend the POST request because the URL still contains valid form data. This is quite normal behavior, especially on mobile browsers, which might handle session history differently than desktop ones.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.