How can I control the effect of browser back button?
by rblampain from LinuxQuestions.org on (#5F75M)
I have an HTML page containing a number of form fields but containing absolutely no user identification as the submission of the form must be anonymous.
When submitted, it calls a CGI script that creates and returns another HTML page with one more unique value (a random passphrase) besides summarizing the entries made in the first form for confirmation.
Clicking the browser back button from this second page returns the visitor to the reset first page allowing to reenter values, generating another "one more unique value" and the cycle can be repeated indefinitely.
However, because files have already been created on server according to it, I need that "one more unique value" to remain unchanged which necessitates skipping part of the code in CGI script when the value exists on subsequent visits.
I can only rely on that "one more unique value" to prevent duplication/multiplication of submitted forms.
Although no expert at it, I am aware of Javascript localStorage which could help.
Another solution would be an added hidden input field but this needs a recorded unique value in the first HTML page before being "downloaded" by the browser but I can not figure what the easiest solution to this problem could be.
I thought I should find it solved on Google but there is absolutely nothing similar or I am not Googling the right keywords.
Can anyone make a suggestion?
Thank you for your help.


When submitted, it calls a CGI script that creates and returns another HTML page with one more unique value (a random passphrase) besides summarizing the entries made in the first form for confirmation.
Clicking the browser back button from this second page returns the visitor to the reset first page allowing to reenter values, generating another "one more unique value" and the cycle can be repeated indefinitely.
However, because files have already been created on server according to it, I need that "one more unique value" to remain unchanged which necessitates skipping part of the code in CGI script when the value exists on subsequent visits.
I can only rely on that "one more unique value" to prevent duplication/multiplication of submitted forms.
Although no expert at it, I am aware of Javascript localStorage which could help.
Another solution would be an added hidden input field but this needs a recorded unique value in the first HTML page before being "downloaded" by the browser but I can not figure what the easiest solution to this problem could be.
I thought I should find it solved on Google but there is absolutely nothing similar or I am not Googling the right keywords.
Can anyone make a suggestion?
Thank you for your help.