When an org has a session timeout value set and the user is interacting with a Visualforce page where the only postback action that the page performs occurs using rerenders, the session will eventually timeout. (or the session timer script running in the page expires)
The big problem with this particular timeout scenario is that the user may have been manipulating a significant amount of data within the page context and not yet committed any of it to the database... which can cause them to lose all of this as-yet-uncommitted data.
I have attempted to manipulate the sessionTimer script which is running in the page using the oncomplete callback of the rerender in the past but have yet to be successful at keeping a 'long running' multiple-postback with rerenders page from eventually timing out and causing grief to the user.
There exists a similar question about
RemoteAction calls - but it does not address the issue of the session timer within the context of the page. Remote Actions and Session Timeout Question
Is there a best-practice way to solve this problem? (aside from informing the user that they must commit their changes before the session timer expires)
An example which has been shown to exhibit this behavior is an
Contact input/edit screen on the same page. The upper section of the page shows the
Account details and the lower section allows the user to [add|edit|remove]
Contact records related to this
The interface includes a button "Add Contact" (with a rerender attribute) which inserts a new
Contact record into a
List collection on the controller and then rerenders the
List<Contact> in the page for presentation to the user for additional input.
If the org has a 15 minute session timeout and the user spends 20 minutes manipulating data in this page and the only POST behavior which has been happening is rerenders, when the user clicks the "Save" button to perform the DML operation and commit their in-page changes they are immediately shown the expired session screen and all of their changes are lost.