Related to the articles above: After a page/form submit, you might see something like this in the Debug Message Data:
Session State: Save form items and p_arg_values
...Session State: saved "P1082_SEARCH_PATTERN_1" new value="" (deferred commit)
...Session State: Save "P1082_SEARCH_PATTERN_2" - saving same value: "Sunshine"
...Session State: commit previous changes
So the new value for "P1082_SEARCH_PATTERN_1" is not
committed! I have been caught out by this a couple of times now; it's hard to spot and even harder to debug...
A workaround (because I have still not found the root cause, grrr): Add a hidden page item to the page, place it in the first region of the page, and make sure its ID is smaller than all others. This item will "absorb" the deferred commit, so that the next items get their correct values. Not elegant but it works.
For example, on pages 1063, 1071, 1072 and 1082 of this site I needed this rather ugly solution.