Posted on: 2012-09-25 22:06:13.000I've been thinking about the Cookie Conundrum and I think it goes beyond just Cookies...
If I want to do a redirect on a page, as Dragonfly does with Response:redirect (something I use all the time) I have to set the headers to be a 302 Redirect. Again, these headers have to be sent before any other text is shown, so it has to be printed at the beginning.
I have changed the way Rockets works to use the Dragonfly model of just loading everything into a big global variable called STDOUT, then delaying printing until the end where you print the headers first and then STDOUT. Only I can't force the delay because there isn't a main program in charge of loading each page, so you have to remember to add the new function (display-page) at the end of your pages for it to work.
Hmm. Not sure about this. I'll think about it some more.