Fixing the return URL
In the catalog, the user’s preferences for category, page, and page size are preserved using a query string, but these are lost when checking out when data is preserved in the session instead. I don’t care too much about preserving the category and page, because they are temporary choices, but I would like to preserve the page size so that it is used when the user completes an order or cancels the order process.
I could store all of the user’s choices in a session or use the query string throughout the order process, but I want to preserve these separate approaches because they demonstrate different ways of solving similar problems. With this in mind, I am going to store the user’s preferred page size in the session at the start of the order process and use the value when generating the URLs that will return the user to the catalog.
The first step is to store the page size as session data when the user transitions from the...