Jaxcent makes this task automatic. To take advantage of this feature, simply mark the pages with "use-session" and "auto-session" flags, during the Jaxcent hook-up of HTML or ASPX pages.
For all pages marked such, Jaxcent will collect data entered into any input fields, and will save it in the session. It does not matter how the user leaves the page, by clicking a button and being sent somewhere else by the web application, typing a URL in, clicking forward/back buttons, following a link... Because the data is collected on the unload event.
If no data validation is required, no code needs to be added for the page. The handler class for these pages can just be "JaxcentPage". (This applies to HTML pages, ASPX pages already have handlers!)
The data is not put directly into the session on a key, but can be retrieved by calling JaxcentPage methods.