I did a search here and using search engines and haven’t found a solution to my problem.
I have a form with a CAPTCHA on it which visitors can use to input data to conduct a search. The original problem was that when the I reached the search results page and hit the browser’s back button, the form data was gone. I found two solutions:
header('Cache-control: private');
header('Cache-Control: max-age=3600');
Both methods work fine to cache the form data (I use only one header, not both). The problem is that the CAPTCHA image is also cached. I do not want that.
Is there a solution using a PHP header I can use to allow caching of the form data but require the CAPTCHA image to be refreshed?
If there is no way to do that using a header in PHP, is there a way to refresh the CAPTCHA when the back button is pressed using Javascript?
Any ideas? Thanks for your help.