I'm running into a situation where Safari on iOS 6 (haven't tested earlier versions) is sending values in POST data that do not exist as form inputs in the current page, but were sent in previous POSTs to the same URL.
Here's the scenario:
- User is sent to a URL for a login page with some query parameters, let's say
/login?x=1,y=2
- User enters incorrect credentials, is presented the login page again with
x
andy
embedded in the form as hidden inputs. - User hits the "back" button in Safari, which GETs
/login
. The values ofx
andy
are now lost and are not included as hidden form inputs. - The user enters incorrect credentials again, and here's where it gets weird. The POST data that comes through contains the username and password the user just entered, as well as the previously submitted value of
x
, but noty
. In this specific web app, the presence ofx
withouty
is an invalid state for this specific POST and results in an error.
I have verified that Safari is actually doing a GET rather than using a cached version of the page in step 3.
For what it's worth, I have the Cache-Control response header set to no-cache, no-store, must-revalidate
UPDATE: I went ahead and filed a bug with Apple to ensure they're aware of this. If I receive any feedback I'll post it here.