I stumbled on an issue that took some time to resolve.
I have created plain HTML form. After user submits form, he is lead to page that informs him if all fields content is valid or if there is any other problem with form.
At that point user may decide he wants to go back to form, change something and submit again. That worked quite fine. User clucks on Back button on his browser, it opens previous page, which is the form,it is prefilled with his data and everything was fine.
I was stumbled.
Searching Internet did not help much as keywords I could think of are to common and return results that are not related to my problem.
However, I found a tiny clue in some of the sources: that it might be related to PHP session.
I decided to try. I disabled sessions in code, and tested form. It actually worked. With session not started, form acted as expected.
Further investigation revealed that browser caching is related to PHP session, and for some reason, starting session, means clearing browser cache (even if you are actually within the same session).
Hopefully there is an easy solution: before starting session session_cache_limiter(‘private’) should be called. That fixed problem for me. Form works fine after that.