Ferreteria/v0.5/stash: Difference between revisions

From Woozle Writes Code
Jump to navigation Jump to search
(Created page with "{{fmt/title|Ferreteria 0.5: message stashing}} ==About== Sometimes a process emits output right before a redirect needs to happen -- most commonly in response to a form submis...")
 
No edit summary
Line 3: Line 3:
Sometimes a process emits output right before a redirect needs to happen -- most commonly in response to a form submission (we do a redirect right after processing POST input in order to prevent accidental data resubmissions).
Sometimes a process emits output right before a redirect needs to happen -- most commonly in response to a form submission (we do a redirect right after processing POST input in order to prevent accidental data resubmissions).


For this reason, the redirect system checks for output (which would/should not yet have been sent to the screen anyway), stashes it via the {{l/same|stash}} cookie, and then does the redirect. The page object should always look for any stashed content to display, adding it at the top of any content it adds to the render. (This last part is currently not working, 2022-12-03.)
For this reason, the redirect system checks for output (which would/should not yet have been sent to the screen anyway), saves it in the user's browser via the {{l/same|stash}} cookie, and then does the redirect. The page object should always look for any stashed content to display, adding it at the top of any content it adds to the render. (This last part is currently not working, 2022-12-03.)
==Notes==
The message text gets submitted to {{l/ver/class|caPageContent}}->AddText(), which presumably adds it to the output buffer that the redirect process fetches from to toss over to the stash.

Revision as of 20:00, 3 December 2022

Ferreteria 0.5: message stashing

About

Sometimes a process emits output right before a redirect needs to happen -- most commonly in response to a form submission (we do a redirect right after processing POST input in order to prevent accidental data resubmissions).

For this reason, the redirect system checks for output (which would/should not yet have been sent to the screen anyway), saves it in the user's browser via the stash cookie, and then does the redirect. The page object should always look for any stashed content to display, adding it at the top of any content it adds to the render. (This last part is currently not working, 2022-12-03.)

Notes

The message text gets submitted to caPageContent->AddText(), which presumably adds it to the output buffer that the redirect process fetches from to toss over to the stash.